Which output would be displayed if the code that is shown below is entered in a Python interpreter?

IT Questions BankCategory: Introduction to IoTWhich output would be displayed if the code that is shown below is entered in a Python interpreter?

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

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x