STEP 4: Now we're ready to start writing get_high_scores()!

You can open files in Python using the open() command. This is like clicking on a file, but with code!

open()'s second parameter is the mode in which we access our file. "r" means we're reading, but not editing it.

  • In SUBJECT, click on and drag Open in Read Mode inside get_high_scores().
  • Then, change "my_file.txt" to file_name.

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)