Q. Which method of the iterable object returns an iterator object for the collection?

  • (A) iterator()
  • (B) _iterator_()
  • (C) _iteration_()
  • (D) _return_iterator_()
πŸ’¬ Discuss
βœ… Correct Answer: (B) _iterator_()
Explanation: An iterable object represents a collection of values that can be iterated. An iterable object must define a method named __iterator__() (with two underscores at the start and end of the name) which returns an iterator object for the collection.
Explanation by: Mr. Dubey
An iterable object represents a collection of values that can be iterated. An iterable object must define a method named __iterator__() (with two underscores at the start and end of the name) which returns an iterator object for the collection.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
161
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate