Question 4
Back to Exercise
What is the output of the following Python program?
x = 10 # x = 20
"""x = 30"""
print(x)
- A 20
- B 30
- C SyntaxError
- D 10 Correct
Correct Answer: Option D
Everything after # is ignored, and the triple-quoted line is just a string expression that is evaluated and thrown away – it assigns nothing.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!