Python Hurricanes Analysis Project (step 2)

Hey! Just started my Hurricane Analysis project (https://www.codecademy.com/paths/data-analyst/tracks/dacp-python-fundamentals/modules/dscp-python-dictionaries-challenge-projects/projects/hurricane-analysis) and I’m already stuck on updating the damages to floats and running the conversions - I feel like the code I have makes sense, and I’m not sure what’s wrong with it that it’s not working.

# Update Recorded Damages
conversion = {"M": 1000000,
              "B": 1000000000}
updated_damages = []

#convert damages to floats
def damages_float(damages):
  for damage in damages:
    if damage == "Damage not recorded":
      updated_damages.append(damage)
    if damage[-1] == "M":
      updated_damages.append(damage.strip("M")*conversion["M"])
    if damage[-1] ==  "B":
      updated_damages.append(damage.strip("B")*conversion["B"])

# test function by updating damages
updated_damages = damages_float(damages)
print(updated_damages)

I know I’m missing something but I’ve tried a variety of other solutions and nothing seems to be getting me there (including using .find with != and, at one point, just ignoring the dictionary altogether and trying with integers).

Any guidance would be much appreciated. Thanks!

You’ve not explained what’s wrong, errors or unexpected behaviour etc.
I think the following might be a useful hint-

test = "a" * 3
print(test)

The unexpected result is that there’s…no result. Nothing prints. I don’t get an error but I also don’t get any text, or an empty list, or…anything.

I’m not sure I follow the hint?

Well I did say it might be useful, guessing what’s wrong is tricky business though I think it may prove useful. As for your issue, it might be worth having a brief recap of functions. It is often necessary to be somewhat literal when programming. If you want to get the computer to perform a task then you need to explicitly state you want that task done. So your function does not print or return anything, it’s worth double checking as to whether or not you asked it to.