class Bus: def __init__(self,passengers = None): if passengers is None: self.passengers = [] else: self.passengers = list(passengers)#创建副本,防御可变参数 def pick(self,name): self.passengers.append(name) def drop(self,name): self.passengers.remove(name)
标签:move remove one lis gpo div drop list color
class Bus: def __init__(self,passengers = None): if passengers is None: self.passengers = [] else: self.passengers = list(passengers)#创建副本,防御可变参数 def pick(self,name): self.passengers.append(name) def drop(self,name): self.passengers.remove(name)
标签:move remove one lis gpo div drop list color
原文地址:https://www.cnblogs.com/Erick-L/p/8343126.html