python如何让返回值是可选的,如:
def test():
return "hello","world" # 此处使"world"返回值是可选的
t1 = test()
print(t1) # 这里希望输出hello而不是("hello","world")
t2,t3 = test()
print(t2,t3) # 这里是正常输出:hello world
python如何让返回值是可选的,如:
def test():
return "hello","world" # 此处使"world"返回值是可选的
t1 = test()
print(t1) # 这里希望输出hello而不是("hello","world")
t2,t3 = test()
print(t2,t3) # 这里是正常输出:hello world