Question: Write a program that takes the number of faces from the user, rolls the dice 5 times. Sum up those values and find the average

Write a program that takes the number of faces from the user, rolls the dice 5 times. Sum up those values and find the average of those values. Print the sum and the average at the end. Your program should ask user for the number of faces, like this: How many faces does your die have? 8 and generate an output like this: Your die has 8 faces You have rolled it 5 times The sum is: 26 The average is: 5.2 NOTE: In order to auto-grade your program, zyBooks needs to be able to predict what the 'random' rolls of the die will be. This is done with the random seed function. When developing and testing your program, you can comment out the line with random seed(1111) so that you will see 'random' rolls. When you are ready to submit for testing, you must uncomment that line so that zyBooks will be able to predict, duplicate, and check the dice rolls LAB ACTIVITY 16.10.1: Lab 5B: Roll the Dice 0/25 ACTIVITY 16.10.1: Lab 5B: Roll the Dice 0/25 main.py Load default template 1 Let's import random 2 import random 4 c ent out the following line while testing and playing with your pro otherwise 5 your dice will always roll the same thing every time for a given number of faces 6 But it must be uncommented, with exactly the value 1111, when you sub it for rading 7 random seed (1111) 9 10 Take the number of faces from the user - Int(input (how many faces does your dice have? ")) " 12 13 14 Roll your dice 5 times ** Calculate sum of all values that you got after rolling it calculate the average of those values" in 16 # Print the output 17 print("Your die has", "faces.") 18 print("You have rolled it 5 times.) 19 print("The sun is: ", Sun) 20 print the avera , wan
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
