刚才那个代码有误,我把全部贴出来classintSet(object):def__init__(self):#creatanemptysetofintegersself.vals=[]definsert(self,e):#assumeeisaninterger,andinsertitifnot(einself.vals):self.vals.append(e)defmember(self,e):returneinself.valsdefremove(self,e):try:self.vals.remove(e)except:raiseValueError(str(e)+'notfound')def__str__(self):#returnastringrepresentationofselfself.vals.sort()return"{"+','.join([str(e)foreinself.vals])+"}"初学,return后面这一句依然没看懂.join在这里是method吗,这个格式是怎么回事
波斯汪
相关分类