Python iter() FunctionThe python iter() function is used to return an iterator object. It creates an object which can be iterated one element at a time. SignatureParametersobject: An iterable object. sentinel (optional)- It is a special value that represents the end of a sequence. ReturnIt returns an iterator object. Python iter() Function Example 1The below example shows the working of iter(). Output: 1 2 3 4 5 Explanation: In the above example, iter() function converts an list iterable to an iterator. Next TopicPython Functions |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India