Running this code, we get an output similar to:
import random
To gain a deeper understanding of probability, let's simulate multiple rolls of the die. We can modify the code to roll the die multiple times and keep track of the frequency of each outcome.
print(roll_die())
for _ in range(num_rolls): roll = roll_die() outcomes[roll - 1] += 1