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
30
7
101
17K
Smart💡
Smart💡@capt_ivo·
@PythonPr Here Is the output 👇👇 SyntaxError: unterminated string literal.
English
0
0
4
957
Akshat
Akshat@akshat_ipynb·
@PythonPr will give error as " is not closed in print statement
English
0
0
2
5
Ranjan
Ranjan@Ranjanrgdev·
@PythonPr world. else Error because " is not closed . @grok am i correct ?
English
1
0
2
1K
Sergei Kotov
Sergei Kotov@kotov_dev·
@PythonPr Answer: B) world Step by step: › n = 20 › if n == 15: checks if 20 equals 15 › 20 ≠ 15, so condition is False › else block runs and prints "world" For beginners: == checks equality. Single = assigns, double == compares.
English
1
0
1
784
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr Output: Error (SyntaxError: unterminated string literal) Reason: In the else block you wrote print("world) — the closing double quote " is missing, so Python thinks the string never ends and throws that SyntaxError.
English
0
0
1
27
Jimmy Fikes
Jimmy Fikes@akajim·
@PythonPr B. “world” will print since 20 does not equal 15.
English
1
0
0
440
milX
milX@nabrukadmezar·
@PythonPr Normally world, but there is a bad syntax
English
0
0
0
30
Jenny
Jenny@JennyTheDev·
@PythonPr B. world 20 != 15, so else kicks in. If you said 35, wrong quiz.
English
1
0
0
1.1K
Shalom Chimdike
Shalom Chimdike@Shalomshoes·
@PythonPr Syntax Error. Was the closing quotation marks used to bake pizza?
English
0
0
0
261
Prem Prakash
Prem Prakash@4EverPrem·
@PythonPr Error. There is no end quote inside else statement. It should be "World"
English
0
0
0
43
Paylaş