• Go to and drag out Random Integer. Change my_var to rand_index.
  • Programs start counting at 0, so set the first range value to 0. That's the first word in the list.
  • The second value in the range will be the total number of words in your list minus 1. If you have 10 words in your list then you would set the range to (0, 9).

Try counting the words in your list by counting the first word as 0 and the second word as 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)