当前位置:网站首页>What does it mean when lambda is not entered?
What does it mean when lambda is not entered?
2022-07-03 02:43:00 【strawberry47】
Looking at the code today , See a code [lambda: gym.make("SimulatedEnv-v0", ) for _ in range(args.training_num)]
;
Yes lambda
, But the colon is empty , No input , The output is the pile on the right . My first reaction was this lambda
Is it possible not to
Later, I did an experiment , It's found that it can't be removed !
def f(x):
return x * 100
print([f(3) for i in range(5)])
print([lambda: f(3) for i in range(5)])
The former is a pile of results list, The latter is a function list:
[300, 300, 300, 300, 300]
[<function <listcomp>.<lambda> at 0x7fe7019acb80>, <function <listcomp>.<lambda> at 0x7fe7019acc10>, <function <listcomp>.<lambda> at 0x7fe7019acca0>, <function <listcomp>.<lambda> at 0x7fe7019acd30>, <function <listcomp>.<lambda> at 0x7fe7019acdc0>]
边栏推荐
- random shuffle注意
- Gbase 8C system table PG_ amop
- Kubernetes family container housekeeper pod online Q & A?
- Gbase 8C system table PG_ collation
- What does "where 1=1" mean
- 簡單理解svg
- [shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
- Random shuffle note
- [tutorial] chrome turns off cross domain policies CORS and samesite, and brings cookies across domains
- [advanced ROS] Lesson 6 recording and playback in ROS (rosbag)
猜你喜欢
4. Classes and objects
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
【翻译】后台项目加入了CNCF孵化器
搭建私有云盘 cloudreve
[Hcia]No.15 Vlan间通信
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
面试项目技术栈总结
sql server数据库添加 mdf数据库文件,遇到的报错
Mathematical statistics -- Sampling and sampling distribution
怎么将yolov5中的PANet层改为BiFPN
随机推荐
Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
5. File operation
定了,就选它
Mathematical statistics -- Sampling and sampling distribution
A2L file parsing based on CAN bus (2)
SQL Server Query spécifie la structure de la table
【教程】chrome关闭跨域策略cors、samesite,跨域带上cookie
【翻译】Flux安全。通过模糊处理获得更多信心
简单理解svg
xiaodi-笔记
Simple understanding of SVG
Informatics Olympiad one general question bank 1006 a+b questions
JS的装箱和拆箱
Add automatic model generation function to hade
Two dimensional format array format index subscript continuity problem leads to return JSON format problem
[translation] flux is safe. Gain more confidence through fuzzy processing
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
Gbase 8C system table PG_ cast
How to change the panet layer in yolov5 to bifpn
Tongda OA V12 process center