livepython.net

165. Python Program to Roll Two Dice Using random.seed

Easyrandom

Overview

Random dice that the tests can still check, thanks to a seed.

Problem Statement

Read a whole number, the seed. Call random.seed() with it, then roll two dice: call random.randint(1, 6) twice, first for the first dice, then for the second. Print both rolls and the total. If both dice show the same number, print Doubles! on a last line. For example, for the seed 1:

Dice: 2 and 5
Total: 7

With a seed, the same input always gives the same rolls, so the tests know what to expect. Roll in exactly this order, with nothing else random before it.

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One whole number, the seed. Example:

1

Output

The output for that example:

Dice: 2 and 5
Total: 7

The tests try 4 different inputs.

Learn this firstChapter 18 · Python random Module: randint, choice and shuffle
solution.py
# write your code here

EXPECTED OUTPUT

1Dice: 2 and 5
2Total: 7

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.