I have the following code to create empty dictionary:
empty_dict = dict.fromkeys(['apple','ball'])
empty_dict = {'apple': None, 'ball': None}
I have this empty dictionary.
Now I want to add the values from value.txt which has the following content:
value.txt
1
2
I want the resultant dictionary to be as:
{
"apple" : 1,
"ball" : 2
}
I'm not sure how to update only the value from the dictionary.