Python · Generators & Iterators
What does this print? def g(): x = 10 yield x x += 5 yield x it = g() print(next(it)) print(next(it))
Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.
Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.
Free to start — download the app or use it in your browser.