Q
What happens when x = 017 is written in Python 3?
-
A
x becomes 17
-
B
SyntaxError: leading zeros are not allowed in decimal literals
-
C
x becomes 15
-
D
x becomes the string '017'
Correct Answer:
B. SyntaxError: leading zeros are not allowed in decimal literals
Explanation:
Python 3 requires the 0o prefix for octal, as in 0o17. A bare leading zero is rejected.