← Quiz: Iterators and Generators: all 10 questions
Quiz: Iterators and Generators · Question 1 of 10
What does iter([1, 2, 3]) return?
What does iter([1, 2, 3]) return?
- A.The list [1, 2, 3]
- B.An iterator over the list
- C.The first item, 1
- D.A generator function
Answer & explanation
Correct answer: An iterator over the list
iter() returns an iterator object that next() can step through.
Can you get the rest right without peeking?
Take the timed Quiz: Iterators and Generators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →