Question 18

Last Updated :
Discuss
Comments

Find the output

Python
sq = (x*x for x in range(3))
print(next(sq))
print(next(sq))
print(next(sq))
print(next(sq))



0, 1, 4, StopIteration

1, 4, 9, StopIteration


0, 1, 4, 9

Error

Tags:
Share your thoughts in the comments