Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下是正确的 Python 代码吗?如果不是,那么这种表达式的正确语法是什么?
x = lambda (y, z=None) : y if z == None else z
您不需要括号:
x = lambda y, z=None: y if z is None else z