Hurricane Analysis Project

Below is my solution to part one - it just prints ‘Damages not recorded’ again and again. Can anyone please help with why this doesn’t work. Thanks

def updated_damages(old_list):
new_list =
for item in old_list:
for i in range(0, len(item)):
if item[i-1] in old_list == ‘M’:
item.replace(‘M’,‘000000’)
new_list.append(item)
elif item[i-1] in old_list == ‘B’:
item.replace(‘B’,‘00000000’)
new_list.append(item)
else:
new_list.append(item)
return new_list

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.