Question 41
What will be printed by the following code snippet?
keys = ['a', 'b', 'c']
vals = [1, 2]
d = dict(zip(keys, vals))
print(d)
zip() stops as soon as the shortest input iterable is exhausted (vals length 2). Hence, d contains {'a': 1, 'b': 2}.