Fill in the blanks to replace all '!' characters in str with a dot '.' x = str. replace (' ', ' ') | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Fill in the blanks to replace all '!' characters in str with a dot '.' x = str. replace (' ', ' ')

anyone explain this question .? i couldn't understand the statement plz explain it .. how it is solved .. i lose 3 lives heart on this question unfortunately...

6th Jul 2023, 7:02 AM
Arooj Amina
Arooj Amina - avatar
5 Answers
+ 6
There it asking to fill the blanks with correct answer. ex: str.replace( existing_word, replace_word) will return a new string with all words having "existing_word" , will be replaced by "replace_word". So it will new string having "replace_word", inplaces of "existing_word". for ex: s1 = "abcda" s2 = s.replace("a", "z") now s2 will be having value "zbcdz". #all "a" is replaced by "z". So can you now guess the correct answer of your question? hope it helps...
6th Jul 2023, 7:22 AM
Jayakrishna 🇮🇳
+ 2
No x = str.replace('!', '.') No space and '!' is gets replaced with dot(.). *"Check the output. 1st argument('!') , is old word and is replaced by 2nd argument word ('.') is new word will appears..
7th Jul 2023, 6:48 AM
Jayakrishna 🇮🇳
+ 1
I guess x = str. replave(' .', '!') Is this true?
7th Jul 2023, 5:31 AM
Arooj Amina
Arooj Amina - avatar
0
Yes, is true
6th Jul 2023, 5:03 PM
Alvaro
Alvaro - avatar
0
replace*
7th Jul 2023, 5:32 AM
Arooj Amina
Arooj Amina - avatar