在python中,遍历list使用for循环。python中的list对象是可迭代对象,所以可以直接用for循环遍历list中的每一个数据。 python中的list对象是可迭代的所以可以直接使用for循环遍历list中的所有数据。 ls = [1, 2, 3, 4] for i in ls: print(i) 结果是: 1 2 3 4 推荐课程:Sublime编辑器(Corey Schafer)