What is difference between for loop and iterator in python?

When a for loop is executed, for statement calls iter() on the object, which it is supposed to loop over. If this call is successful, the iter call will return an iterator object that defines the method __next__() , which accesses elements of the object one at a time.

Sizin İçin Seçtik  Kripto para OTC nedir?

Leave a Reply

Your email address will not be published. Required fields are marked *