当前位置:网站首页>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 ,
边栏推荐
- Use dumping to back up tidb cluster data to S3 compatible storage
- LDAP application (4) Jenkins access
- 2022.02.13 - NC002. sort
- Colorlog结合logging打印有颜色的日志
- [cloud native] teach you how to build ferry open source work order system
- JVM performance tuning and practical basic theory - Part 1
- 被破解毁掉的国产游戏之光
- [MySQL] log
- [secretly kill little partner pytorch20 days -day01- example of structured data modeling process]
- 如何进行接口测试测?有哪些注意事项?保姆级解读
猜你喜欢

根据csv文件某一列字符串中某个数字排序

Leetcode question brushing (5.28) hash table
![[cloud native] teach you how to build ferry open source work order system](/img/fb/507f763791235bd00bc8201e5d7741.png)
[cloud native] teach you how to build ferry open source work order system

JVM performance tuning and practical basic theory - Part 1

The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?

Hungry for 4 years + Ali for 2 years: some conclusions and Thoughts on the road of research and development

2022.02.13 - NC002. sort

Bottom up - physical layer

指针进阶---指针数组,数组指针

Deep learning: derivation of shallow neural networks and deep neural networks
随机推荐
MySQL learning record 11jdbcstatement object, SQL injection problem and Preparedstatement object
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
IoT -- 解读物联网四层架构
Visual implementation and inspection of visdom
LDAP应用篇(4)Jenkins接入
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
visdom可视化实现与检查介绍
C language - bit segment
[cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
Deep learning: derivation of shallow neural networks and deep neural networks
C language custom type: struct
Research and investment forecast report of citronellol industry in China (2022 Edition)
Image fusion -- challenges, opportunities and Countermeasures
On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced
Upgrade tidb operator
Leetcode question brushing (5.31) string
Analysis of pointer and array written test questions
synchronized 解决共享带来的问题
[brush questions] top101 must be brushed in the interview of niuke.com
MySQL learning record 07 index (simple understanding)