Google News
logo
Python Program to Loop through an iterator
In the following example of Python program to loop through an iterator :
Program :
my_tuple = ("apple", "banana", "cherry")
my_iter = iter(my_tuple)

for x in my_iter:
  print(x)
Output :
apple
banana
cherry