Hi, im currently working on the coding practice project, section 3, found here: https://www.codecademy.com/practice/projects/hurricane-analysis
I have defined a function, which takes a number of perimeters, all of which are lists. My goal is to make a single dictionary, which combines an item from each of the list, each at a particular index, together into a single dictionary. What i have provided below produces no errors, but it seems to be erasing each entry as it adds another, so that all i am left with is a single dictionary entry with all the information at the end of my range, in this case, 34. How do i make my output, new_dict, is a dictionary of 34 dictionaries? Why is my .update erasing the previous entry each time a new entry is added?
thanks in advance
def hurricane_zip(names, months, years, max_sustained_winds, areas_affected, new_damages, deaths):
new_dict = {}
new_zip = {}
for index in range(0,34):
new_zip.update({"Name": names[index], "Month": months[index], "Year": years[index], "Max Sustained Wind": max_sustained_winds[index], "Areas Affected": areas_affected[index], "Damage": new_damages[index], "Deaths": deaths[index]})
new_dict.update(new_zip)
return new_dict
test = hurricane_zip(names, months, years, max_sustained_winds, areas_affected, new_damages, deaths)
print(test)