In this lesson, you’ll learn about the advanced generators methods of .send(), .throw(), and .close(). To practice with these new methods, you’re going to build a program that can make use of each of the three methods.
As you follow along in the lesson, you’ll learn that yield is an expression, rather than a statement. You can use it as a statement, but you can manipulate a yielded value. You are allowed to .send() a new value back to the generator. You’ll also handle exceptions with .throw() and stop the generator after a given amount of digits with .close().
Imtiaz on July 24, 2020
I do not understand this statement in “infinite_palindromes” function.
i = (yield num)num is yielding but yet in parentheses (generator expression)Also, this whole loop is unclear to me. Can anyone explain or give me some pointer.