+ 3
The string is "x-spam-confidence:0.8745". Now i have to print out only the elements after the colon in python?
i tried slice on the string but not getting the output .now what to do?
1 Antwort
+ 5
if ":" always exists you can do one of this
#With slice
print(s[s.index(":")+1:])
#With split
print(s.split(":")[1])