Dice Thrower

Step 5 – choose the number of dice

Now we'll get the user to tell us how many dice they want to throw.

Do they want 4 six sided dice? Or 10 six sided dice? Or something else?

This is a little harder to do.

It needs to use a loop. That's the for bit of the program.

  1. You might want to start a new program here – it's a little different
  2. Take care with the idents. You know Python is picky with those
  3. Save your program
  4. Run the program to check that it works
  5. Make sure you run your program a few times. Choose different numbers of dice

Getting the indents right is the hardest bit here.

Code helper image

In theory you can choose to roll as many dice as you want to, but Python might get a bit slow if you enter a ridiculously large number.