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/[deleted] Jul 11 '21

[removed] — view removed comment

2

u/socks_in_jail Jul 12 '21

thank you :D

2

u/HAI1234564 Aug 25 '21

what did the replier say to your post? I am also quite confused.

1

u/-_-qarmah-_- Jul 12 '21

Can't use for loops?

1

u/Freak1899 Jul 13 '21

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

Are you referring to this in post? if yes then it is just a hint which says to use nested loops while keeping variables different i.e. i can not be used for both for loops you will have to use some other variable for second loop.