📜  如果函数没有参数 python 代码示例

📅  最后修改于: 2022-03-11 14:45:31.021000             🧑  作者: Mango

代码示例1
def do_something(calculate=None):
    if calculate is None:
        # do that
        return 'Whatever'
    if calculate == "something expected":
        # do this
    return 'Whateverelse'