Print(3 * '7'). How the answer is 777 ?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 3

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

5th Jul 2021, 2:35 AM
Darį“‹į­„Lį“‡É¢į“‡É“Dąæ YT
4 Respostas
- 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