Get the App
SLTechnology News&Howtos  ›  Development  › 

Python's method of waking up using send

Shulou Source: shulou.com Published: 2022-05-31 17:49:22 09月21日 Update

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

Tags: Knowledge articles functions methods code advantages content functions objects source code programs languages support programming different powerful large binary traditional powerful Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker Linux Apple macOS