runtime
43 / 500
question 43 Loops & Iteration · easy

Clean a typed amount

An expenses form lets people type amounts like $1,299.50. float() refuses the dollar sign and the comma. Build a cleaned text that keeps only the digits and the decimal point, convert it with float(), and print it.

First lineamount_text = "$1,299.50". Check runs your program again with other typed amounts
PrintsAmount: 1299.5
Keepthe characters 0123456789 and .; drop everything else
Expected output1 line
  1. 1Amount: 1299.5

Loading your progress…

Clean a typed amount — Python practice · Runtime