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 211 views
1 answer 263 views
3 answers 367 views
1 answer 235 views
...