- 10
What is the output of this code? >>> print(3 * '7')
What is the output of this code? >>> print(3 * '7')
11 Answers
+ 4
it should be 777, i think you should run this yourself and dont ask question about this unless you dont understand, what happen
+ 3
Denise Roßberg
In Python (3 * '7'), repeats the string '7' three times.
Example: (4 * '!') => !!!!
+ 2
*AsterisK* Interresting. In Java it would be 165 (3 *55).
+ 1
Python: 777;
console.log(3*'7'); // 21;
What will be the conclusion:
1) echo 3*'7';
2) cout << 3*'7';
3) Console.WriteLine(3*'7');
4) System.out.println(3*'7');
0
Denise Roßberg '7' is a character and characters can be converted to integers by the character position in a constant list of all the available characters. When '7' is converted to integer it returns value 55.
0
777
0
777
0
34 answer
0
777
0
It's 777