Dice Thrower

Dice image

Step 1 – throw a die

Lets start by throwing a single six sided die.

That's a normal "dice" to you.

This is pretty easy in Python.

It uses a library of routines that people have already written called random. So we need to start by importing that library – which is there the import random line comes in

  1. Start by opening Python
  2. Then go File > New File to open your blank Python canvas to code in
  3. Use the code in the screenshot
  4. Save your program
  5. Run the program to check that it works
  6. Make sure you run your program a few times. You should get a random pattern of die throws – all of which should be between 1 and 6!

It's a pretty simple program to start with.

Code helper image

The die rolls should be random.

Note: a single dice is called a "die"; "dice" is the plural. So it's "one die" and "two dice".