STEP 20: It's been a long school year and you can't remember what your highest grade was. Let's find it!

To get the last item in a list, you can use the special index -1. This index always returns the last item.

  • Go to and drag Sort List to the bottom of main(). Change my_list to grades.
  • Drag in Get Value at Index. Change my_var to highest_grade and my_list to grades.
  • Change the index in the square brackets from 0 to -1.

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)