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
34
18
203
20.4K
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@PythonPr Answer: Technically, nothing (no returns, doesn't even print quotes) Solution: `*` of str and int gives repetition of string. Eg, "Py" * 3 gives "PyPyPy" If the multiplication is by 0, means 0 repetitions of the str, ie, empty string. So, "Python" * 0 is "" When printed, +
English
1
0
11
1.4K
SK
SK@SKoffical_ai·
@PythonPr D empty string
English
0
0
0
1K
Alonemax
Alonemax@14Alonemax·
@PythonPr Nothing is printed, because python word is string and we are multiplying string with zero which return empty space or print("")
English
0
0
0
483
Okosun Adrian
Okosun Adrian@adriancityman·
@PythonPr Omon you trying to print a str and multiplying an int without int(‘python’) I forgot the word and you expect an answer aside from system error
English
0
0
0
62
Hakeem Boah
Hakeem Boah@HakeemBoah·
@PythonPr ANSWER is D) "" Or more practically, doesn't print anything at all, not even the empty quotes in option D
English
0
0
0
88
Paylaş