Examveda

What will be the output of the following Python code?
def f(x):
    for i in range(5):
        yield i
g=f(8)
print(list(g))

A. [0, 1, 2, 3, 4]

B. [1, 2, 3, 4, 5, 6, 7, 8]

C. [1, 2, 3, 4, 5]

D. [0, 1, 2, 3, 4, 5, 6, 7]

Answer: Option A


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

Join The Discussion

Related Questions on Exception Handling in Python