Which output would be displayed if the code that is shown below is entered in a Python interpreter?
y = ['yellow', 'red', 'green', 'purple', 'white'] print y
- y
- yellow, red, green, purple, white
- 'yellow', 'red', 'green', 'purple', 'white'
- It shows "SyntaxError"
Explanation: Refer to curriculum topic: 2.1.3
A syntax error would be printed because the variable to be printed has to be in parenthesis (y).
Exam with this question: Introduction to IoT – Chapter 2 Quiz Answers
Please login or Register to submit your answer