How to return an iterator from a tuple in Python

1 Answer

0 votes
tpl = ("abc", "uvw", "xyz")
tplit = iter(tpl)

for i in range(0, len(tpl)):
    print(next(tplit))


'''
run:

abc
uvw
xyz

'''

 



answered Dec 15, 2024 by avibootz

Related questions

2 answers 100 views
1 answer 185 views
3 answers 218 views
1 answer 158 views
...