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

Join The Discussion