INSTRUCTION:
The data is organized such that the data at each index, from 0 to 33, corresponds to the same hurricane.
For example, names[0] yield the “Cuba I” hurricane, which occurred in months[0] (October) years[0] (1924).
Write a function that constructs a dictionary made out of the lists, where the keys of the dictionary are the names of the hurricanes, and the values are dictionaries themselves containing a key for each piece of data (Name, Month, Year, Max Sustained Wind, Areas Affected, Damage, Death) about the hurricane.
Thus the key "Cuba I" would have the value: {'Name': 'Cuba I', 'Month': 'October', 'Year': 1924, 'Max Sustained Wind': 165, 'Areas Affected': ['Central America', 'Mexico', 'Cuba', 'Florida', 'The Bahamas'], 'Damage': 'Damages not recorded', 'Deaths': 90}.
THESE ARE THE LISTS:
names = ['Cuba I', 'San Felipe II Okeechobee', 'Cuba II']
months = ['October', 'September', 'September']
years = [1924, 1928, 1932]
max_sustained_winds = [165, 160, 160]
areas_affected = [['Central America', 'Mexico', 'Cuba', 'Florida', 'The Bahamas'], ['Lesser Antilles', 'The Bahamas', 'United States East Coast', 'Atlantic Canada'], ['The Bahamas', 'Northeastern United States']]
damages = ['Damages not recorded', '100M', 'Damages not recorded', '40M']
deaths = [90,4000,16]
THE CODE I HAVE TRIED:
hurricane_records = list(zip(names, months, years, max_sustained_winds, areas_affected, update_damages(), deaths))
dict1 = {}
strongest_hurricane_records = {}
for i in range(len(names)):
dict1["Name"] = hurricane_records[i][0]
dict1["Month"] = hurricane_records[i][1]
dict1["Year"] = hurricane_records[i][2]
dict1["Max Sustained Wind"] = hurricane_records[i][3]
dict1["Areas Affected"] = hurricane_records[i][4]
dict1["Damage"] = hurricane_records[i][5]
dict1["Deaths"] = hurricane_records[i][6]
strongest_hurricane_records[names[i]] = dict1
print(strongest_hurricane_records["Cuba I"])
My problem here is that when I tried to access the dictionary "Cuba I", instead of printing the values of "Cuba I" dictionary, it is printing the last dictionary which is this:
{'Cuba II', 'September', 1928, 160, ['Lesser Antilles', 'The Bahamas', 'United States East Coast', 'Atlantic Canada'], '100M', 4000}