Por que print(3*'7') imprime 3 veces 7 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Por que print(3*'7') imprime 3 veces 7

Python

26th Sep 2021, 8:34 PM
Carlos Amador
2 Answers
+ 5
Carlos Amador Because 7 is a string so when you multiply with number then it will be display number of times. That's why here 777
26th Sep 2021, 8:38 PM
A͢J
A͢J - avatar
+ 1
Carlos Amador 3 veces una cadena o carácter en este caso representa 777. Si '7' hubiera sido un número entero, entonces las matemáticas normales
26th Sep 2021, 10:41 PM
BroFar
BroFar - avatar