LISTS, PART 3: We know that lists are ordered but we don't always know the index of the item we need.

  • Drag Get Index of Value into the ADD CODE section. This will get the list index of your score.
  • Change my_var to rank. This will store your rank, since we've ordered the list of scores from high to low!
  • Change the code after the equals sign so that it checks score_list for your score.
  • Lists begin counting at index 0! This means we should add 1 to your rank, since there is no rank 0.

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)