python iterables and understanding iterator

First, what is iterables,

Simple to understand that objects can be used for cycles, that is iterable. For example: list, string, dict, tuple generators.

Having characteristics iterations.

Second, what is the iterator

First iteration is to understand what it means?

Iteration: for each time the process is repeated once called "iteration", and the initial value of each iteration will be obtained as a result of the next iteration.

That iterator is: a machine each iteration of the initial value of the results obtained will be used as the next iteration.

Iterables not iterator, using built-in function in python iter () can be an iterative iterator object becomes.

Iterator = iter () + iterables

 

Reference links:

https://www.runoob.com/python/python-func-iter.html

https://www.cnblogs.com/yudanqu/p/9084501.html

Guess you like

Origin www.cnblogs.com/-Neo/p/11199535.html