Please explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please explain

What the difference between these codes? And why we r learning string functions and don’t use it in practice? https://code.sololearn.com/caDnWBMmq7t9/?ref=app

5th May 2022, 10:21 AM
Ivan Horlenko
2 Answers
+ 3
It's right, you can use that way, and there are many other ways to do that. But note that str.replace(old,new) replaces all `old` in str with `new`, if the string contains more than one 'user' it won't work. So concatenating strings remains a clean simple solution in this task without the need of more functions and stuff..
5th May 2022, 11:09 AM
Sousou
Sousou - avatar
+ 1
Thanks
5th May 2022, 11:28 AM
Ivan Horlenko