解决TypeError: 'int' object is not iterable执行程序是遇到如下报错: 原因:循环中使用的应该是一组数,而不是一个数,加上range即可 for i in len(a) 错误 for i in range(len(a)) 正确