Back
What does error TypeError: 'NoneType' object is not iterable mean?
I am getting it on this Python code:
def write_file(data, filename):#creates file and writes list to it with open(filename, 'wb') as outfile: writer = csv.writer(outfile) for row in data: # ABOVE ERROR IS THROWN HERE writer.writerow(row)
def write_file(data, filename):
#creates file and writes list to it
with open(filename, 'wb') as outfile:
writer = csv.writer(outfile)
for row in data:
# ABOVE ERROR IS THROWN HERE
writer.writerow(row)
The TypeError you are getting means the value of data is None.
To know more about this you can have a look at the following video tutorial:-
31k questions
32.8k answers
501 comments
693 users