Python's method of waking up using send
Today, the editor will share with you the relevant knowledge points about python's use of send to wake up. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Description
1. In addition to using the next () function to wake up the generator to continue execution, you can also use the send () function to wake up execution.
2. One of the advantages of using the send () function is that you can transfer additional data to the breakpoint while waking up.
Example
Def fun (): I = 0 while I