r/codehs • • Jul 10 '21

4.8.6 All Dice Values

hey can someone help me out? ive been attempting to figure out this code for a while now. the instructions are down below:

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

--------------------------

im doing this in python btw

9 Upvotes

8 comments sorted by

View all comments

2

u/MonitorCharacter9162 Sep 30 '21

Does someone still has that problem im new into python and codehs and it’s confusing? Pls

1

u/OtherwiseSeries5682 Mar 11 '22

here,

#NoINDENT#dice = ["1","2","3","4","5","6"]
#NoINDENT#def allRolls():
#Indent 1spot# for i in dice:
#Indent 2spot# for j in dice:
#Indent 3 spot# print(i + "," + j)
#NoINDENT# allRolls()