认证高级PHP讲师
There is a standard solution for this, which iszip:
zip
>>> l1 = ['a', 'b', 'c'] >>> l2 = ['x', 'y', 'z'] >>> l3 = zip(l1, l2) >>> l3 [('a', 'x'), ('b', 'y'), ('c', 'z')]
Then you can just loop over l3 in the template.
There is a standard solution for this, which is
zip
:Then you can just loop over l3 in the template.