python如何让返回值是可选的,如:
def test(): return "hello","world" # 此处使"world"返回值是可选的 t1 = test() print(t1) # 这里希望输出hello而不是("hello","world") t2,t3 = test() print(t2,t3) # 这里是正常输出:hello world
收起
python应该不支持这种写法吧
报告相同问题?