解决TypeError: 'int' object is not iterable

执行程序是遇到如下报错:
在这里插入图片描述
原因:循环中使用的应该是一组数,而不是一个数,加上range即可
for i in len(a) 错误
for i in range(len(a)) 正确