总是说'tuple' object is not callable这个怎么解决啊
现在又有这个问题了我就重新复制粘贴了一下
收起
重新改了代码
import numpy
list1 = numpy.random.randint(0,12,20)
tuple1 = tuple(list1)
print(tuple1)
newList = []
for x in tuple1:
if x not in newList:
newList.append(x)
newList.sort()
for i in newList:
print("%d程序的次数%d" % (i,tuple1.count(i)))
提两个建议
1、命名最好不要用类似关键字的的名称,
可以考虑用 val_list1 val_tuple1 , 免得看晕
2、提问时, 把代码用 插入代码块功能 复制一下 , 这样大家好直接试
报告相同问题?