We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddcb43f commit dced859Copy full SHA for dced859
ex_06_05.py
@@ -0,0 +1,12 @@
1
+str = 'X-DSPAM-Confidence: 0.8475' # a random string
2
+
3
+ipos = str.find(':') #find where ':' is located
4
+print(ipos) # printing the value of ipos: location of the ':'
5
+piece = str[ipos+1:]
6
+print(piece) # printing the string after the index position of ipos+1
7
+# print(piece+42.0) # will fail
8
+value = float(piece)
9
+print(value) # printing the float value
10
+print(value+42.0) # printing the float value with addition of 45.0
11
+piece = str[ipos+2:]
12
+print(piece) # printing the string after the index position of ipos+2
0 commit comments