In this we are going to see a basic program on iterators using try and except in Python Programming Language.
list = [3, 5, 7, 8, 4, 7]
iter = iter(list)
while True:
try:
elem = next(iter)
print(elem)
except StopIteration:
break
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP