Examveda

What will be the output of the following Python code?
#generator
def f(x):
    yield x+1
g=f(8)
print(next(g))

A. 8

B. 9

C. 7

D. Error

Answer: Option B


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

Join The Discussion

Related Questions on Exception Handling in Python