?
What will be the output of the following Python code?
What will be the output of the following Python code?
def f(x):
yield x+1
print("test")
yield x+2
g=f(10)
print(next(g))
print(next(g))
def f(x):
yield x+1
print("test")
yield x+2
g=f(10)
print(next(g))
print(next(g))
Join the Discussion
Login to post a comment or share your explanation.
Login