Python Strings: Medical Insurance Project Part 22 Extra

So I’ve been attempting to do the extra assignment part 22 on the Python Strings: Medical Insurance Project on Jupyter. Im attempting to remove the “$” from my insurance cost, however, its not processing through which in turn is not allowing me to calculate to total insurance cost which stops me from getting the average. Whenever I attempt to strip it, it tells me that the “List Object has no attribute to strip.”

I’m just seeking some assistance in stripping the dollar symbol from the code so that I can move forward with getting the average_insurance_costs

If you have something like this

costs = ["$342", "$156", "$205"]

and you’d like to take out the $ and turn the strings into numbers (floats)
then you could do loop
or a list comprehension, like this

costs = [ float(amount.strip('$')) for amount in costs]

or you could do each one individually

costs[0] = float(costs[0].strip('$'))
costs[1] = float(costs[1].strip('$'))
costs[2] = float(costs[2].strip('$'))

or you could do that with a loop.