Answers for "python for loop with enumerate and zip"

10

enumerate zip python

alist = ['a1', 'a2', 'a3']
blist = ['b1', 'b2', 'b3']

for i, (a, b) in enumerate(zip(alist, blist)):
    print i, a, b
Posted by: Guest on March-18-2020
0

for loop with zip and enumerate

for i, t in enumerate(zip(names, ages)):
    print(i, t[0], t[1])
Posted by: Guest on July-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language