215k views
3 votes
-Roll 2 standard dice

-If the sum of the dice are greater than 8, print “The sum of the dice is ____”
- print “done” at the end of the code

User Sam
by
8.3k points

1 Answer

1 vote

In python:

import random

die1 = random.randint(1,6)

die2 = random.randint(1,6)

if die1 + die2 > 8:

print(f"The sum of the dice is {die1 + die2}")

print("done")

If you need me to change anything, I will. I hope this helps!

User Agniva De Sarker
by
8.5k points

No related questions found