WARNING: This program has a bug, or error. So let's debug it!

RULE: If you try to write to a file that was opened in read-only mode ("r"), then you'll get an error.

  • Click Run and read the error message that pops up. Then click OK.
  • Change the mode in which we're opening the file "student_scores.csv" from "r" to "w".
  • Change Run to see if you fixed the program. When it's fixed, click Submit and Next.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)