Python data structures Assignment 6.5

Coursera: Python data structures
Assignment 6.5 
Week 1:

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

Solution:-

text = "X-DSPAM-Confidence:    0.8475";
a=text.find(':')
b=text[a+2: ]
c=float(b)

print(c)





Coursera official website:


Comments

Popular posts from this blog

Python data structures: Assignment 7.1

Python data structure: Assignment 8.4

Programming for everybody (Python) Assignment 5.2

Coursera:Web application technologies and Django