Open In App

Python-Quizzes | Python String Quiz | Question 10

Like Article
Like
Save Article
Save
Share
Report issue
Report

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


Last Updated : 18 Sep, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads