Study Guide

5.4.6 Rolling Dice CodeHS Answers

5.4.6 Rolling Dice CodeHS Answers

The most common answer is:

for i in range(1, 7):
    for x in range(1, 7):
        print(str(i) + ", " + str(x))

This code will print all possible outcomes of rolling two six-sided dice, with each die’s result separated by a comma and a space for clarity.