Python_切割和查找
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.(题目来源于书本"python for everybody")-COURSERA
text = "X-DSPAM-Confidence: 0.8475"
snum = float(text.find('0')) #23
real_num = text[int(snum):]
print(real_num)
浙公网安备 33010602011771号