From d08a9e9bf3d42f52106a3927d90f3b63fac3112b Mon Sep 17 00:00:00 2001 From: Edward Lau Date: Fri, 16 Oct 2020 14:57:15 -0600 Subject: [PATCH] Revert "Update wk6 - assignment 6.5.py" --- wk6 - assignment 6.5.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wk6 - assignment 6.5.py b/wk6 - assignment 6.5.py index 8583ea8..f035132 100644 --- a/wk6 - assignment 6.5.py +++ b/wk6 - assignment 6.5.py @@ -2,10 +2,11 @@ #Convert the extracted value to a floating point number and print it out. text = "X-DSPAM-Confidence: 0.8475"; -str = 'X-DSPAM-Confidence: 0.8475' -ipos = str.find(':') -#print(ipos) -piece = str[ipos+2:] -#print(piece) -value = float(piece) -print(value) + +space = text.find(" ") + +substring = text[space:] +substring = substring.strip() +substring = float(substring) + +print substring \ No newline at end of file