1
name = ['Taro', 'Jiro', 'Saburo']
job = ['Brave', 'Warrior', 'Wizard']
d= {}
for x, y in zip(name, job):
d[x] = y
print(d)
Execution result of 1
{'Taro': 'Brave', 'Jiro': 'Warrior', 'Saburo': 'Wizard'}
If you write this in dictionary comprehensive notation
Dictionary comprehensive notation
name = ['Taro', 'Jiro', 'Saburo']
job = ['Brave', 'Warrior', 'Wizard']
d = {x: y for x, y in zip(name, job)}
print(d)
Execution result of dictionary comprehensive notation
{'Taro': 'Brave', 'Jiro': 'Warrior', 'Saburo': 'Wizard'}