🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: itertools and functools: all 10 questions

Quiz: itertools and functools · Question 9 of 10

Why should count() or cycle() always be combined with a limit like islice?

Why should count() or cycle() always be combined with a limit like islice?

  1. A.They return lists that are too big
  2. B.They produce values forever
  3. C.They only work inside islice
  4. D.They raise StopIteration immediately
Answer & explanation

Correct answer: They produce values forever

Without a limit, looping over them never ends.

Can you get the rest right without peeking?

Take the timed Quiz: itertools and functools quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →