Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary comprehensions

names = ['Bruce', 'Clark', 'Peter', 'Logan', 'Wade']
heros = ['Batman', 'Superman', 'Spiderman', 'Wolverine', 'Deadpool']

my_dict= {name: hero for name, hero in zip(name,hero)}
Source by www.datacamp.com #
 
PREVIOUS NEXT
Tagged: #python #dictionary #comprehensions
ADD COMMENT
Topic
Name
2+3 =