python里的简洁操作

1、lambda匿名函数好处
精简代码,lambda省去了定义函数,map省去了写for循环过程:res=list(map(lambda x:'test' if x=='' else x,a))

 


 

 

 

posted @ 2022-08-25 15:48  何双新  阅读(35)  评论(0编辑  收藏  举报