Answers for "iterate through multiple lists python"

16

looping through two lists python

for f, b in zip(foo, bar):
    print(f, b)
Posted by: Guest on March-30-2020
0

iterate through multiple lists python

# Python program to iterate
# over 3 lists using itertools.zip_longest
  
import itertools 
  
num = [1, 2, 3]
color = ['red', 'while', 'black']
value = [255, 256]
  
# iterates over 3 lists and till all are exhausted
for (a, b, c) in itertools.zip_longest(num, color, value):
    print (a, b, c)
Posted by: Guest on September-21-2021
0

loop two lists python

for f, b in zip(foo, bar):
    print(f, b)
Posted by: Guest on November-23-2020

Code answers related to "iterate through multiple lists python"

Browse Popular Code Answers by Language