Zipping does not do what I thought, it seems to drop items.
names = ['nik', 'katie', 'james', "katie"]
ages = [32, 31, 34, 106]
my_dict = dict(zip(names, ages))
print(my_dict)
This gives:
{'nik': 32, 'katie': 106, 'james': 34}
Where did my younger Katie go? And how do I use zip to create a dictionary that keeps my original list length and doesn’t drop any items?
1