With zip()
words = ['Mon', 'Tue', 'Wed']
nums = [1, 2, 3]
# Use zip to pack into a tuple list
for w, n in zip(words, nums):
print('%d:%s, ' %(n, w))
Prints: 1:Mon, 2:Tue, 3:Wed,
Comments
words = ['Mon', 'Tue', 'Wed']
nums = [1, 2, 3]
# Use zip to pack into a tuple list
for w, n in zip(words, nums):
print('%d:%s, ' %(n, w))
Prints: 1:Mon, 2:Tue, 3:Wed,