STEP 7: Now let's create a random number to pick a random index from the head list!

  • Go to and drag Random Integer to the bottom of your program (in the second section!).
  • Change the variable name from my_var to random_head.
  • Change the range in .randint() to 0, 5.

Remember: there are 6 items in the list, so the first index is 0 and the last index is 5.

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)