序列解压
>>> a,b,c,d = (1,2,3,4)
>>> a
1
>>> d
4
>>> a,_,_,d=(1,2,3,4)
>>> a
1
>>> d
4
>>> a,*_=(1,2,3,4)
>>> *_,d=(1,2,3,4)
>>> a
1
>>> d
4
#也适用于字符串、列表、字典、集合
>>> a,b = {'name':'eva','age':18}
>>> a
'name'
>>> b
'age'
参数陷阱:默认参数是一个可变数据类型
def defult_param(a,l = []): l.append(a) print(l) defult_param(1) defult_param(2) defult_param(3,[]) defult_param(4)