(app.py)
return render_template("trump_list.html", data=zip(list1,list2))
(Jinja2)
{% for text, ET in data%}
<div class="content-section">
{{text | safe}}
{{ET}} in ET <h6>(New York/Washington D.C Time)</h6>
</div>
{% endfor %}
*Zip関数の一般的な書き方
names = ['Alice', 'Bob', 'Charlie']
ages = [24, 50, 18]
points = [100, 85, 90]
for name, age, point in zip(names, ages, points):
print(name, age, point)
0 件のコメント:
コメントを投稿