Question: Use a function from the Python random module. The random module helps us to generate random numbers for playing a dice game. Write a
Use a function from the Python random module. The random module helps us to generate random numbers for playing a dice game. Write a program (called RandomNumbers.py) that uses the randint function from the random module to generate and display 50 random numbers between 1 and 6 that can be rolled with a dice. After displaying the 50 random numbers, the program also displays the counts of 1's, 2's, 3's, 4's, 5's and 6's. Submit your code. A Sample output will be: Average of 50 random numbers: 3.56 Total number of 1s: 7 Total number of 2s: 9 Total number of 3s: 7 Total number of 4s: 10 Total number of 5s: 9 Total number of 6s: 8
Step by Step Solution
3.51 Rating (144 Votes )
There are 3 Steps involved in it
import random module import random define empty list numlist define for loop which runs 50 times and ... View full answer
Get step-by-step solutions from verified subject matter experts
