python lambda表达式能返回布尔类型吗?能的话举个例子谢谢

如题所述

f = lambda x: x==1
print(f(3))  # False
print(f(1))  # True

温馨提示:答案为网友推荐,仅供参考
相似回答