Examveda

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))

A. No output

B. 11
12

C. 11
test

D. 11

Answer: Option B


This Question Belongs to Python Program >> Exception Handling In Python

Join The Discussion

Related Questions on Exception Handling in Python