Question: In a simple dice game, rolling a 5 or 6 is considered a win and rolling a 1, 2, 3, or 4 is considered a
In a simple dice game, rolling a 5 or 6 is considered a win and rolling a 1, 2, 3, or 4 is considered a loss. use "python"
What is the probability of winning? __________________
What is the probability of losing? ____________________
Write a Python program that will count the total number of wins and losses for the number of rolls specified in the List, numRolls, shown below. For each of the values in numRolls, output the percent wins and percent losses.
numRolls = [10 100 1000 10000 100000 1000000]
To generate a dice roll in Python, do the following:
import random
roll = random.randint(1,6) # Randomly generates an integer from 1 to 6
heres a exasmple of how it should look
Example of Program Output (Results will vary since roll is random):
For 10 Rolls
Percent Wins: 10.0
Percent Losses: 90.0
For 100 Rolls
Percent Wins: 41.0
Percent Losses: 59.0
For 1000 Rolls
Percent Wins: 33.2
Percent Losses: 66.8
For 10000 Rolls
Percent Wins: 32.98
Percent Losses: 67.02
For 100000 Rolls
Percent Wins: 33.109
Percent Losses: 66.891
For 1000000 Rolls
Percent Wins: 33.3036
Percent Losses: 66.6964
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
