Hurricane Analysis - Data Scientist Career Path

Here is my code for Part 1 of the Hurricane Analysis project on the Data Scientist Career Path

conversion = {“M”: 1000000,
“B”: 1000000000}

new_damages = []
def update_damages(data):
  for i in data:
    if "M" in i:
      new_damages.append(float(i.strip("M")) * conversion["M"])
    elif "B" in i:
      new_damages.append(float(i.strip("B")) * conversion["B"])
    else: 
      new_damages.append(i)

Hope this helps someone :slight_smile: