How to loop two lists in python
How to loop two lists in python? materialLst= (A, B, X)
priceLst = (55, 12, 23)
for (m, p) in some_iterator(materialLst, priceLst):
print("m: ", m, "; p: ", p)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rajanikant HawaldarRank #110 · 20.2K reputationPosted Dec 25, 2020, 4:26 AM EST
Sagar LadRank #523 · 4.7K reputationPosted Aug 19, 2021, 10:33 AM EDT
Hi Ayush,
You can also use zip function :
for (f,b) in zip(foo, bar): print ("f: ", f ,"; b: ", b)