Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

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)

closed

1 Answer

0 votes
by (106k points)
edited by
 
Best answer

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:-

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...