+ 1
Generators
Can we say that yield is similar to return function only it do not stop the loop as return do ?
1 Answer
+ 3
Yes, that's what yield do. Everything you yield something you're adding that to a range of things. Range function itself in python3 is considered as a generator {in python2 is considered as a list}. Remember, giant lists will let you out of memory, Giants yields will let you out of time!!