LearnFrenzy
Sign in Take a free test

Iterators and Generators · Iterators and Generators MCQ · Question 15

Is range an iterator? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 15 Back to Exercise

Which statement about range(5) is true?

  • A It is a generator
  • B It is an iterator and can be used only once
  • C It is a list
  • D It is an iterable sequence (supports len and indexing), not an iterator Correct
Correct Answer: Option D

next(range(5)) raises TypeError; you can loop over the same range many times.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links