Python报 TypeError: 'NoneType' object is not iterable
原因: None是不可迭代的。
list1 = ["a",'b'] list2 = list1.reverse() # list1.reverse() 不应赋值给另一个变量,此时list2的值为None for i in list2: # 因为list2的值为None,无法迭代,所以报错 print(i)
您的电子邮箱地址不会被公开。 必填项已用*标注
评论 *
显示名称 *
电子邮箱地址 *
网站地址
在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。