为什么我又找不到自己的错误在哪。。。。。
file:///D:/X%7BX03%5DVXABYF0IK6(6MVO34.pngclass CountList:
def __init__(self,*args):
self.values =
print(self.values)
self.count = {}.fromkeys(range(len(self.values)),0)
def __len__(self):
return len(self.values)
def __getitem__(self,key):
self.count += 1
return self.values
SyntaxError: inconsistent use of tabs and spaces in indentation 本帖最后由 永恒的蓝色梦想 于 2020-8-19 15:16 编辑
class CountList:
def __init__(self,*args):
self.values =
print(self.values)
self.count = dict.fromkeys(range(len(self.values)),0)
def __len__(self):
return len(self.values)
def __getitem__(self,key):
self.count += 1
return self.values 缩进 Tab 和空格混用了,而且你的代码中还有一个拼写错误。帮你改好了:
class CountList:
def __init__(self, *args):
self.values =
print(self.values)
self.count = {}.fromkeys(range(len(self.values)), 0)
def __len__(self):
return len(self.values)
def __getitem__(self, key):
self.count += 1
return self.values zltzlt 发表于 2020-8-19 15:13
缩进 Tab 和空格混用了,而且你的代码中还有一个拼写错误。帮你改好了:
谢谢大佬
页:
[1]