dihan2170 dihan2170
  • 28-10-2020
  • Computers and Technology
contestada

-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

Respuesta :

Cytokine
Cytokine Cytokine
  • 28-10-2020

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!

Answer Link

Otras preguntas

Type of democracy where citizens elect leaders to represent them in government
In what ways were the mycenaeans different from the minoans
How many triangles are in a octagon?
How many triangles are in a octagon?
what are Marco Polo's important achievements? what are his legacies? how has he impacted the way we interact the trade with countries today?
In what ways were the mycenaeans different from the minoans
What Motives does Columbus appeal to in trying to interest Spanish rulers in the new land?
Explain the  stages of a spider life cycle
in what ways did the sea shape Greek culture, myth, economy, and trade?
Estimate the sum of 6416,5734, and 4912 to the nearest thousand