Vidyalelo
Python · Q56

Exception Handling in Python

Programming · Python · question 56

Q56

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]
Answer
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

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board