Suppose you have two lists of strings, the first one being the keys
for the dictionary, and the second being the values
for the keys of corresponding position. So it's something like this:
>>print keys
['key1', 'key2', ..., 'keyN']
>>print values
['value1', 'value2', ..., 'valueN']
with this line of code:
dic = dict.fromkeys(keys)
I've assigned the keys to my dictionary. So my output is something like this now:
>>print dic
{'key1': None, 'key2':None, ..., 'keyN': None}
Can I somehow do the same thing I did with the keys, but with the values as well? But only this time store the values one by one to the dictionary? So my targeted output is something like this:
>>print dic
{'key1':'value1', 'key2':'value2', ..., 'keyN':'valueN'}