当前位置:网站首页>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>]
边栏推荐
- ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
- random shuffle注意
- [shutter] banner carousel component (shutter_wiper plug-in | swiper component)
- 疫情当头,作为Leader如何进行代码版本和需求开发管控?| 社区征文
- leetcode540
- HW initial preparation
- Summary of interview project technology stack
- 【教程】chrome关闭跨域策略cors、samesite,跨域带上cookie
- Hcip137-147 title + analysis
- [translation] modern application load balancing with centralized control plane
猜你喜欢
Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers
SQL statement
[translation] the background project has joined the CNCF incubator
Matlab tips (24) RBF, GRNN, PNN neural network
"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
Can netstat still play like this?
The data in servlet is transferred to JSP page, and the problem cannot be displayed using El expression ${}
Pytest (6) -fixture (Firmware)
Principle and application of database
Add automatic model generation function to hade
随机推荐
What does "where 1=1" mean
HW-初始准备
GBase 8c系统表-pg_conversion
QT qcombobox add qccheckbox (drop-down list box insert check box, including source code + comments)
The difference between left value and right value in C language
GBase 8c 函数/存储过程参数(二)
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
Kubernetes cluster log and efk architecture log scheme
Random shuffle note
sql server 查询指定表的表结构
基于can总线的A2L文件解析(2)
Gbase 8C create user / role example 2
The core idea of performance optimization, dry goods sharing
5. File operation
Gbase 8C trigger (II)
The Linux server needs to install the agent software EPS (agent) database
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
Informatics Olympiad one general question bank 1006 a+b questions
Word word word
Hcip137-147 title + analysis