spam=[]
spam2=[]
for i in range(0,10):
    spam.extend(str(i))#extend 添加的元素必须是可以迭代的对象,所以不能添加整型
    spam2.append(i)
print(spam2)

 

相关文章: