Solution 1
@app.route('/breakloop')
def breakloop():
Top10 = {"a":10,"b":15,"c":5,"d":8,"e":4}
colors = ["blue", "black", "red"]
return render_template('breakloop.html', zipped=zip(Top10.items(), colors))
{% for (key, value), color in zipped %}
{ x: "{{key}}", y: {{ value }}, fill = "{{ color }}" },
{% endfor %}
{ x: "a", y: 10, fill = "blue" },
{ x: "b", y: 15, fill = "black" },
{ x: "c", y: 5, fill = "red" },
Solution 2
Top10 = {"a":10,"b":15,"c":5,"d":8,"e":4}
Colors = ["blue", "black", "red"]
Zipped = zip(Top10.iteritems(), Colors)
for (key, value), color in Zipped:
print(key,value,color)