+ 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
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..
+ 1
Thanks