Question
What is the output of the code shown below?def f(x): yield x+1 print("test") yield x+2g=f(9)
Answer: Option D
Was this answer helpful ?
The code shown above will not yield any output. This is because when we try to yield 9, and there is no next(g), the iteration stops. Hence there is no output.
Was this answer helpful ?
Submit Solution