I am unsure if a dictionary can have values without keys, but am trying to learn more about dictionaries in python. I created a dictionary as follows:
dict={'Type': 'Electric_car', 'Make': 'Tesla', 'Model': 'S', 'Year': 2020, 'Price': 21000, '': 22.2}
I want to update the blank key in the dictionary to "Power":22.2
This is how I tried, which is obviously wrong.
for key, value in dict.items():
if value==22.2:
dict[key]=dict["Power"]
Is there any way to update the key by using the value?