+ 1
Help to understand
second cycle 'for' doesnt work. why? https://code.sololearn.com/cOvsKRGS3q77/?ref=app
9 odpowiedzi
+ 2
c is a generator. You can only traverse or iterate over it once.
+ 2
Read the answer marked best. Very enlightening.
https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do
+ 2
Look. If you want you can convert generator to list. For loops will work all the time
https://code.sololearn.com/cgIB2uO0ur1Y/?ref=app
+ 2
thanks again!!!!
+ 2
a'm learning python only month. by myself. its my first experience.
+ 2
You seem to be doing fine... And when you have questions we are here to help ☺☺
+ 1
Oh sorry! What is says is that yield creates a generator and generator can only be iterated over one time
That is why your first for loop works but not the second ☺
0
good article. but english difficult for me to understand completly(((