def a(L=[]): L.append('END') return L print(a()) >>>['END'] def a(L=[]): L.append('END') return L print(a(),a()) >>>['END','END'] ['END','END'] def a(L=[]): L.append('END') return L print(a(),a(),a()) >>>['END','END','END'] ['END','END','END'] ['END','END','END'] ...
需指向不变参数。 def a(L=None): if L is None: L=[] L.append('end') return L print(a()) print(a())
Sign in to make a reply
用户5868763182