+ 1

How to make objects dictionary

12th Feb 2019, 7:40 AM
Haider
2 Answers
+ 2
Can you describe your issue more, I didn't get it.
12th Feb 2019, 7:44 AM
Seb TheS
Seb TheS - avatar
+ 2
Like this? keys = list(range(1, 6)) values = list('abcde') d = {k: v for k, v in zip(keys, values)} print(d) # {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}
12th Feb 2019, 11:15 AM
Anna
Anna - avatar