Select true statements. (select two) a. An iterator is an object that has a __iter__() method that returns an iterator object. b. An iterator is an object that implements the __next__() method that returns the next element of the iterable object, or throws a StopIteration exception when there are no more elements available. c. Any function in Python is an iterator.

Questions & AnswersCategory: PythonSelect true statements. (select two) a. An iterator is an object that has a __iter__() method that returns an iterator object. b. An iterator is an object that implements the __next__() method that returns the next element of the iterable object, or throws a StopIteration exception when there are no more elements available. c. Any function in Python is an iterator.
Geek Boy Staff asked 2 years ago

Select true statements. (select two)

a. An iterator is an object that has a __iter__() method that returns an iterator object.

b. An iterator is an object that implements the __next__() method that returns the next element of the iterable object, or throws a StopIteration exception when there are no more elements available.

c. Any function in Python is an iterator.

1 Answers
Geek Boy Staff answered 2 years ago

a. An iterator is an object that has a __iter__() method that returns an iterator object.
b. An iterator is an object that implements the __next__() method that returns the next element of the iterable object, or throws a StopIteration exception when there are no more elements available.