The string is "x-spam-confidence:0.8745". Now i have to print out only the elements after the colon in python? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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?

28th May 2018, 4:52 PM
AISHWARYA KASTHALA
AISHWARYA KASTHALA - avatar
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])
28th May 2018, 4:59 PM
Francisco Casas
Francisco Casas - avatar