How to print a,b,c values by using custom generator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to print a,b,c values by using custom generator

How to print a,b,c values by using custom generator

3rd Feb 2022, 5:40 AM
Manoj Bhaagam
1 Answer
+ 2
myiterator = (c for c in "abc") for i in range(3): print(next(myiterator)) use a list or another iterable instead of "abc"
3rd Feb 2022, 8:15 AM
Oma Falk
Oma Falk - avatar