What is the output of the following snippet?
y = 2 + 3 * 5. print(Y)
- the snippet will cause an execution error
- 17
- 25.
- 17.0
Explanation: Python is case-sensitive, so y and Y are two different variables. Since the program attempts to print to the screen a value associated with a variable that does not exist in the local namespace, Python doesn’t recognize it, and a NameError exception is raised.
More Questions: Python Essentials 1 – Module 2 Test
Please login or Register to submit your answer