1. 程式人生 > >python 函數與retune

python 函數與retune

python return

函數帶參的優先級

def func_add(name,age=23 *args,**kwargs):

return 1,2,name,[1,2]

t=func_add

print(t)


():
    a = ()
    b = ()
    c = a | b
    c[]

(re_test())


({‘d‘, ‘a‘, ‘f‘, ‘s‘}, 1, 2, 3, [333, 78])


默認return值為null

如返回多個參數系統將默認參數為一個元組返回


python 函數與retune