Question from the Python - Fundamentals test

Print the elements of a list using an iterator in Python

Hard

What is the output of the following code ?

a = [x for x in range(5)]
b = iter(a)
i = 0
while i < len(a):
	print(next(b), end=" ")
Author: ThéoStatus: PublishedQuestion passed 1197 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!