【发布时间】:2019-08-08 14:18:40
【问题描述】:
我正在尝试使用 Django 为一些 RNA 序列着色。我正在使用 enumerate 和 zip 在列表中查找等于索引。例如:
for i, (a, b) in enumerate(zip(seq1, seq2)):
if a == b and i not in green:
<p style="color: green;">{{i}}</p>
elif a != b and i not in red:
<p style="color: red;">{{i}}</p>
我在模板中收到此错误:
'for' 语句应该使用格式'for x in y':for i, (a, b) in 枚举(zip(seq1,seq2)):
【问题讨论】:
标签: python django jinja2 enumerate