Sail E0 Webinar
Question
What is the output of the following?a = [0, 1, 2, 3]for a[0] in a:    print(a[0])
Options:
A .  0 1 2 3
B .  0 1 2 2
C .  3 3 3 3
D .  error
Answer: Option A


The value of a[0] changes in each iteration. Since the first value that it takes is itself, there is no visible error in the current example.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers