I'm learning python in Coursera, I tried the assignment for the course but am not getting the desired result. This program is supposed to extract '0.8475' and convert it to float before printing it.
text = "X-DSPAM-Confidence: 0.8475";
ParseError: bad input on line 5
As @ZdaR mentions, the call to the
float function must pass the parameter inside the parentheses as
p = float(s). I tested this in Python IDLE and the program worked correctly.
Also note that you should not end lines with
; in Python. The whitespace itself will handle that for you when you start a new line.