text = "X-Dspam-Confidence: 0.8475" ; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

text = "X-Dspam-Confidence: 0.8475" ;

Write code using find() and string slicing to extract the number at the end of the line below.Convert the extracted value to a floating point number and print it out

28th Jun 2020, 8:38 AM
Aditya Deepak Lohar
Aditya Deepak Lohar - avatar
2 Answers
+ 5
We can't so your homework here. Pls show your attempt
28th Jun 2020, 8:40 AM
Nilesh
0
str = "X-Dspam-Confidence:0.8475" ipos = str find('0.8475') piece = str (ipos + 2:) value = float (piece) print (value)
28th Jun 2020, 8:45 AM
Aditya Deepak Lohar
Aditya Deepak Lohar - avatar