+ 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

7th May 2020, 8:44 AM
_nrkvv_
_nrkvv_ - avatar
3 ответов
+ 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('!','')
7th May 2020, 8:56 AM
Lothar
Lothar - avatar
+ 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()))
7th May 2020, 8:21 PM
Harjot Singh
Harjot Singh - avatar