brostace brostace
  • 12-01-2021
  • Computers and Technology
contestada

Write a program that prints all possible dice rolls with two dice. To do so, you should use a nested for loop.

Hint: You can’t use i for both for loops.

Here’s what your program should print

1,1
1,2
1,3
1,4
1,5
1,6
2,1
...
...
6,4
6,5
6,6

Respuesta :

Cytokine
Cytokine Cytokine
  • 12-01-2021

for x in range(1,7):

   for w in range(1,7):

       print(str(x)+","+str(w))

I wrote my code in python 3.8. I hope this helps.

Answer Link

Otras preguntas

how did cleopatras action affect rome
HELP 9 •8 +16 / 4 Rewrite the expression so that addition is performed first. 9 •8 +16 / 4 Rewrite the expression so that division is performed first.
Omega-3 fatty acids found in fish may reduce the risk for heart disease and play a role in vision O True False
All angles in the figure at the right are right angles what is the agree of the figure F.14 G.18 H.28 I.36
Find the equation of the line with slope m=−5/3 that contains the point (9,−15).
1) Which is greater? Circle one for each. a) 63 or 102 Answer: b) 332 or 32. 30 Answer: c) (0.11) or (1.1)? Answer:
HELP ME ON THIS QUESTION 10 POINTS PLZ
I believe the answer is B.
What is the slope of the line? 10 15 20 25
Ask: How can theme BEST be expressed in a text? How can theme best be expressed in a text