Python fund. "medical insurance project" #22

https://www.codecademy.com/paths/data-analyst/tracks/dacp-python-fundamentals/modules/dscp-python-strings/projects/ds-python-strings-project

Ciao everyone. :slight_smile:
Iโ€™m doing the last extra practice, the exercise asks me to * Calculate the average insurance cost in insurance_costs . You will have to remove the $ in order to calculate this."

I tried with this and in order to find the total and removing I used replace, but I get stuck here.

cost =
for n in insurance_costs:
cost.append(n.replace(โ€™$โ€™,โ€™โ€™))
total_cost = 0
for element in cost:
print(element)
for v in element:
total_cost += v
print(total_cost)

any helps or hints are appreciated
thanks everyone!

1 Like

Hello! Could you please format your code in the proper way so we can see what it really looks like?

Also, what is the specific problem youโ€™re having? What did you expect the result to be, and what result do you actually get?

I sorted out after many attempts, thanks you for the support!