16
What is the output of the following code?
g = (x * 2 for x in range(3))
print(next(g), next(g))DiscussEasy
Loading subject content…
Loading practice questions…
What is the output of the following code?
g = (x * 2 for x in range(3))
print(next(g), next(g))What is the output of the following code?
g = (x for x in [1, 2])
print(list(g), list(g))What is the output of the following code?
def gen():
x = yield 1
yield x * 10
g = gen()
print(next(g), g.send(5))What is the output of the following code?
g = (i for i in range(3))
print(list(g), list(g))