当前位置:网站首页>Generator parameters incoming parameters
Generator parameters incoming parameters
2022-07-06 08:33:00 【MAR-Sky】
The generator can be send Method to pass in parameters
send function : Pass in parameters to The last time yield End assignment position variable , And execute to the next yield Location
def easy_gen():
print('start...')
m = yield 10
print('mid')
print(m)
n = yield 20
print(n)
print('end')
yield 30
gen = easy_gen() # Get the variable that points to the function
gen.__next__() # return 10
gen.send('adga')

Be careful ,__next__() The method is to yield The next number returns ,
边栏推荐
- Bottom up - physical layer
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- PLT in Matplotlib tight_ layout()
- Cisp-pte practice explanation
- All the ArrayList knowledge you want to know is here
- Leetcode question brushing (5.28) hash table
- Analysis of the source code of cocos2d-x for mobile game security (mobile game reverse and protection)
- leetcode刷题 (5.28) 哈希表
- 【MySQL】鎖
- Modify the video name from the name mapping relationship in the table
猜你喜欢

Sublime text in CONDA environment plt Show cannot pop up the problem of displaying pictures
![[secretly kill little partner pytorch20 days -day01- example of structured data modeling process]](/img/ae/4e616882f6d68acdf8e885843e68a3.jpg)
[secretly kill little partner pytorch20 days -day01- example of structured data modeling process]

角色动画(Character Animation)的现状与趋势
![[brush questions] top101 must be brushed in the interview of niuke.com](/img/55/5ca957e65d48e19dbac8043e89e7d9.png)
[brush questions] top101 must be brushed in the interview of niuke.com
![[MySQL] log](/img/e9/1617122888c096cf6aba2bdb88f0ef.png)
[MySQL] log

【ROS】usb_cam相机标定

Analysis of the source code of cocos2d-x for mobile game security (mobile game reverse and protection)

Yyds dry goods inventory three JS source code interpretation eventdispatcher

JS native implementation shuttle box

Synchronized solves problems caused by sharing
随机推荐
Deep analysis of C language data storage in memory
Sort according to a number in a string in a column of CSV file
China high purity silver nitrate Market Research and investment strategy report (2022 Edition)
【刷题】牛客网面试必刷TOP101
2. File operation - write
同一局域网的手机和电脑相互访问,IIS设置
Permutation and combination function
2022.02.13 - NC004. Print number of loops
【MySQL】日志
hutool优雅解析URL链接并获取参数
按位逻辑运算符
3. File operation 3-with
Is it safe to open an account in Zheshang futures?
Research and investment forecast report of citronellol industry in China (2022 Edition)
sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
Bottom up - physical layer
个人电脑好用必备软件(使用过)
VMware 虚拟化集群
China vanadium battery Market Research and future prospects report (2022 Edition)
角色动画(Character Animation)的现状与趋势