Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
56
13
173
27.9K
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@PythonPr Answer: D 9999 Solution: Observe that '9' is a string, not an int. b is an int 4. So, a * b is a multiplication of string and int. Sounds strange, but this is just repetition of the string. So, '9' * 4 is the string '9' repeated 4 times, ie, 9999 that's what gets printed.
English
0
0
11
1.4K
共有