TypeError:int object is not iterable
开始,我打算取列表的前面一部分的数据,结果我少了:,因此报了这个错误
a=[1,2,3]
a=[:2] #这里我错误的写成a=a[2]
for i in a:
print(i)
TypeError:int object is not iterable
开始,我打算取列表的前面一部分的数据,结果我少了:,因此报了这个错误
a=[1,2,3]
a=[:2] #这里我错误的写成a=a[2]
for i in a:
print(i)