0 votes
1 view
in Python by (47.8k 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 (107k 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:-

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...