Ask Question

In Python, what would I use if I wanted to iterate through two or more lists at the same time?

+1
Answers (2)
  1. 11 June, 09:15
    0
    Use the zip () function

    l1 = [1, 2, 3, 4, 5]

    l2 = ['a', 'b', 'c', 'd', 'e']

    for pair in zip (l1, l2):

    print (pair)
  2. 11 June, 09:16
    0
    ZIP IT that's how ...
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “In Python, what would I use if I wanted to iterate through two or more lists at the same time? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers