Issues with Function in Course 3 Wk 1 Assignment

Hi there -

I’m having issues with my function for the BBC News assignment when trying to count the number of labels and sentences. When I remove the code from within the function it seems to be working however within the function i get a “ValueError: I/O operation on closed file.”

I’ve included the screenshots for your reference. Any tips to share to get the “parse_data_from_file” function to run as I’ve been at this for awhile and don’t seem to be getting anywhere?

Thank you!

  • RE

Compare the indentation of the for row expression