Practice Test Geeks home

Hackerrank Iterators and Generators

What is the output of the following code?
python

def count_up(n):

for i in range(n):

yield i

g = count_up(3)

print(next(g))

print(next(g))

Select your answer