+ 2
Help me, please
Hello, how i can print results of this code? def function(sentence): sentence.replace(',',"") sentence.replace('.',"") sentence.replace(':',"") sentence.replace('?',"") sentence.replace('!',"") sentence.replace('"',"") sentence.replace("'","") function(input()) https://code.sololearn.com/ccu07jkZQ84s/?ref=app
3 Answers
+ 3
You have to put
return sentence
as the last line in your function
also your several replace has to be like this:
sentence = sentence.replace('!','')
+ 1
def function(sentence):
sentence=sentence.replace('h',"g")
sentence=sentence.replace('e',"i")
sentence=sentence.replace('l',"t")
sentence=sentence.replace('o',"b")
sentence=sentence.replace('w',"o")
sentence=sentence.replace('r',"c")
sentence=sentence.replace('d',"l")
return sentence
print (function(input()))