xxxxxxxxxx
Food = ["Apple", "lemon", "Mango"]
Food.append("Cake")
Food.remove("lemon")
for x in Food:
print(x)
xxxxxxxxxx
s = "Earthworms and Python are disgusting!"
s.replace('and Python ', '')
print(s)
#Run the code
result = "Earthworms are disgusting!"
xxxxxxxxxx
text='ramkumar'
text=text.replace("mku","") #'' is empty
print(text)
ans:
ramar
xxxxxxxxxx
varible.replace(letter, "") # blank quotes.
# e.g.
s = "Hello World"
print(s.replace('e', ""))
# Hllo World
# great for data cleansing
xxxxxxxxxx
# Python program to remove single occurrences of a character from a string
text= 'ItsMyCoode'
print(text.replace('o','',1))