Python Dictionaries Challenge Project | Codecademy
I’ve written the function but when I print it, I only get the last dictionary. It feels like I’m missing one small step…is there anyone who can help?
def hurricane_dictionary(names, months, max_sustained_winds, areas_affected, damages_updated, deaths):
for i in range(len(names)):
hurricanes_dictionary = {"Name": names[i],
"Month": months[i],
"Year": years[i],
"Max Sustained Wind": max_sustained_winds[i],
"Areas Affected": areas_affected[i],
"Damage": damages_updated[i],
"Deaths": deaths[i]}
return hurricanes_dictionary
print(hurricane_dictionary(names, months, max_sustained_winds, areas_affected, damages_updated, deaths))
This is the response I get:
{'Name': 'Michael', 'Month': 'October', 'Year': 2018, 'Max Sustained Wind': 160, 'Areas Affected': ['Central America', 'United States Gulf Coast (especially Florida Panhandle)'], 'Damage': 25100000000.0, 'Deaths': 74}