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 line
amount_text = "$1,299.50". Check runs your program again with other typed amountsPrints
Amount: 1299.5Keepthe characters
0123456789 and .; drop everything elseExpected output1 line
- 1Amount: 1299.5