🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.The list [1, 2, 3]
  2. B.An iterator over the list
  3. C.The first item, 1
  4. 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 →