The Wayback Machine - http://web.archive.org/web/20210918085008/https://www.geeksforgeeks.org/python-quizzes-python-string-quiz-question-10/
Skip to content
Related Articles

Related Articles

Improve Article

Python-Quizzes | Python String Quiz | Question 10

  • Last Updated : 18 Sep, 2020

Question 10: What is the output of the following program?




x = 123
for i in x: 
    print(i, end=" ") 

(A) 1 2 3
(B) 1 1 1
(C) Error
(D) No Output


Answer: (C)

Explanation: Objects of type int are not iterable instead a list, dictionary or a tuple should be used.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :