+ 2

Help (python)

How can i remove a item in a string in python?

19th Jul 2018, 7:37 PM
I Am Arthur
I Am Arthur - avatar
4 Réponses
+ 11
I just looked this up. apparently strings are immutable in python. you have to make a new string. old = "longtie" print(old) new = old.replace("e", "em") print(new) https://stackoverflow.com/questions/3559559/how-to-delete-a-character-from-a-string-using-python
20th Jul 2018, 2:05 AM
LONGTIE👔
LONGTIE👔 - avatar
+ 2
LONGTIE Checck out my last question please
20th Jul 2018, 3:15 AM
I Am Arthur
I Am Arthur - avatar
+ 1
LONGTIE correct
20th Jul 2018, 2:33 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
old="longtime" print(old) new=del(old) old="longtime" print(old) old.remove(old)
20th Jul 2018, 12:51 PM
pritee mishra