xxxxxxxxxx
>>> papa = 'papa is a good man'
>>> papa.replace('papa', '')
' is a good man'
xxxxxxxxxx
text='ramkumar'
text=text.replace("mku","") #'' is empty
print(text)
ans:
ramar
xxxxxxxxxx
s = "Earthworms and Python are disgusting!"
s.replace('and Python ', '')
print(s)
#Run the code
result = "Earthworms are disgusting!"
xxxxxxxxxx
Food = ["Apple", "lemon", "Mango"]
Food.append("Cake")
Food.remove("lemon")
for x in Food:
print(x)