- 1
How to remove something from list,for ex. I want to remove '?' from a=who are you ?
4 Respostas
+ 3
In Python, strings are immutable, so you need to create a new string. You have several options for how to create a new line. If you want to remove 'M' wherever it appears:
a = "Who are you?"
b = a.replace ("?", "")
----------------------------------------------------------------------------------------
if you want to learn python I recommend you:
Books: "Byte of Python", "Learning Python: Game Programming, Data Visualization, Web Applications. Mathes Eric", "Learn Python Mark Lutz".
Free course: SoloLearn,
W3school: https://www.w3schools.com/
+ 5
Simple just use pop or del function 😽
+ 1
a = "who are you?"
print(a[:-1])
0
How?, please 🥺 tell me