When my first lists has repeating values, it causes the merge to fail for some reason.
names = ['bob', 'bob', 'bob', 'bob']
id = ['15', '12', '19', '20']
rating = ['100', '90', '100', '80']
dictionary = dict(zip(names, zip(id, rating)))
print(dictionary)
will output
{'bob': ('20', '80')}
However, if I simply change all the names to be unique, it will output as expected.
names = ['bob', 'sally', 'john', 'jill']
id = ['15', '12', '19', '20']
rating = ['100', '90', '100', '80']
dictionary = dict(zip(names, zip(id, rating)))
print(dictionary)
same code with unique names now outputs
{'bob': ('15', '100'), 'john': ('19', '100'), 'sally': ('12', '90'), 'jill': ('20', '80')}
What can I do better than "dict(zip(names, zip(id, rating)))" so I can repeat 'bob' as much as I want?