The iter() function returns the iterator object.
Example
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
x = iter(["A", "B", "C","D","E","F"])
for i in iter(x):
print(i)
Output:
A
B
C
D
E
F
Syntax
iter(object)
Parameters
Name | Description |
object | An iterable object |
Return Value
It returns an iterator object.