Consider the following code:
letters = ['A', 'B', 'C']
my_iterator = iter(letters)
print(next(my_iterator))
# 'A'
print(next(my_iterator))
# 'B'
print(next(my_iterator))
# 'C'
print(next(my_iterator))
# ... ?
What will be the next output?
Consider the following code:
letters = ['A', 'B', 'C']
my_iterator = iter(letters)
print(next(my_iterator))
# 'A'
print(next(my_iterator))
# 'B'
print(next(my_iterator))
# 'C'
print(next(my_iterator))
# ... ?
What will be the next output?
Create a free account to access the full topic