Single Choice Not Set

QWhat will be the output after the following statements?
 def gen():
    x = 0
    while True:
        yield x
        x += 1
y = gen()
print(next(y), end='')
print(next(y), end='')
print(next(y), end='')

ID: #3553 Python Generators MCQ 610 views
Question Info
#3553Q ID
Not SetDifficulty
Python Generators MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 012
  • B 123
  • C 111
  • D 000
Correct Answer

Explanation

012
No Previous Next Question

Share This Question

Challenge a friend or share with your study group.