Hi,
I’m working on the programming assignment - Exercise 1: Encountering Data - Reading the News Article. My code follows the exact structure specified in the instructions, using open(text_file, “r”) to open the file, f.read() to read the contents, f.close() to close the file, and returning the contents.
However, the grader returns this error:
Failed test case: Your solution should not use the
withstatement. Grader expected: Use only the
open()function to open the file and read it as: f = open(text_file, "r") contents = f.read() f.close() You got:
with statement found in the implementation
I have verified that my submitted code does not contain a with statement and matches the expected structure. Could this be a grader issue, or is there something specific I might be overlooking? Any guidance would be appreciated.
Thank you!
Daniel