The program below simulates the rolling of three 6-sided dice. A global rolls list is declared without any initial values. Each call to the roll() function should produce one random number between 1 and 6. The function should print "You rolled X", where X is the random number. The function should also append the random number to the end of the rolls global list. After all three rolls, the program will print a summary of all items in the rolls list.

The following examples demonstrate the expected program output.

Enter random seed: 1
You rolled 2
You rolled 5
You rolled 1
All rolls: [2, 5, 1]
Enter random seed: 5
You rolled 5
You rolled 3
You rolled 6
All rolls: [5, 3, 6]
Create the roll() function where shown by the comment to meet the program requirements. Remember, you can generate a random number between 1 and 6 with random.randrange(1,7).

The program below simulates the rolling of three 6-sided dice. A global rolls list is declared without any initial values. Each call to the roll() function should produce one random number between 1 and 6. The function should print "You rolled X", where X is the random number. The function should also append the random number to the end of the rolls global list. After all three rolls, the program will print a summary of all items in the rolls list.

The following examples demonstrate the expected program output.

Enter random seed: 1
You rolled 2
You rolled 5
You rolled 1
All rolls: [2, 5, 1]
Enter random seed: 5
You rolled 5
You rolled 3
You rolled 6
All rolls: [5, 3, 6]
Create the roll() function where shown by the comment to meet the program requirements. Remember, you can generate a random number between 1 and 6 with random.randrange(1,7).

import random

rolls = []

def roll():
num = random.randrange(1, 7)
print("You rolled", num)
rolls.append(num)

random.seed(int(input("Enter random seed: ")))

roll()
roll()
roll()

print("All rolls:", rolls)