Print(3 * '7'). How the answer is 777 ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Print(3 * '7'). How the answer is 777 ??

5th Jul 2021, 2:35 AM
Darᴋ᭄LᴇɢᴇɴD࿐ YT
4 Answers
- 2
It means if it is print ( 4 * '7' ) then it will be 7777 🤨
5th Jul 2021, 2:45 AM
Darᴋ᭄LᴇɢᴇɴD࿐ YT
+ 7
because in python multiplying a string by a scalar give the srring repeated scalar times ^^
5th Jul 2021, 2:40 AM
visph
visph - avatar
+ 5
yes... but why setting my answer as best and finally remove it for your own answer? it's unfair, and doesn't give you any xp ^^
5th Jul 2021, 2:47 AM
visph
visph - avatar
+ 1
Yes you are right visph
5th Jul 2021, 4:00 AM
Sumit Kumar
Sumit Kumar - avatar