...
/Quiz Yourself on Iterators and Generators
Quiz Yourself on Iterators and Generators
Test yourself on iterators and generators with Python.
We'll cover the following...
Quiz
1
What will be the output of the following code snippet?
import itertools
t1=(1, 3, 6)
t2=[4, 1, 4]
t=itertools.chain(t1, t2)
print(next(t1))
A)
Syntax Error
B)
TypeError: ‘tuple’ object is not an iterator
C)
No Error
D)
AttributeError
Question 1 of 30 attempted
Access this course and 1400+ top-rated courses and projects.