I have two lists as:
num_list = [1,2,3,4]
name_list = ["one","two","three","four"]
I want to create a new dictionary with name_list
as keys and num_list
as values.
I'm aware of zip method but I'm trying to do it using for
loop for my own learning . What I've tried as:
new={}
num_list = [1,2,3,4]
name_list = ["one","two","three","four"]
for i in (name_list):
for j in (num_list):
new[i]=j
getting ouptput as:
{'one': 4, 'two': 4, 'three': 4, 'four': 4}
Can anyone explain where I did a mistake??