Python lambda with if but without else

前端 未结 4 1258
长发绾君心
长发绾君心 2021-01-30 20:49

I was writing some lambda functions and couldn\'t figure this out. Is there a way to have something like lambda x: x if (x<3) in python? As lambda a,b: a i

4条回答
提交回复
热议问题