TypeError: 'NoneType' object is not iterable
The error message “TypeError: ‘NoneType’ object is not iterable” typically occurs when you try to iterate over a variable that has a value of None
.
In other words, if you have a line like:
for i in my_variable:
# do something with i
And my_variable
happens to be None
, then you’ll get the error.
To fix this, make sure your variable my_variable
is not None
before trying to iterate over it.
还没有评论,来说两句吧...