STEP 2: Let's change the range of numbers so we always get a value that could appear on a number cube!

The two arguments in .randint(1, 10) are the lowest and highest possible values the computer can randomly select.

  • Since we are rolling dice, the lowest number should be 1 and the highest number should be 6.
  • Change the second argument in .randint() from 10 to 6.

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)