Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python help please would prefer no imports, but they are allowed if necessary Average Number of Times It Takes to Roll Six on a Die

python help please
would prefer no imports, but they are allowed if necessary image text in transcribed
Average Number of Times It Takes to Roll Six on a Die Write a well-documented Python program, hmwk5Q1.py, to simulate the rolling a die until the number SIX is first obtained. Repeat the experiment 100,000 times and print out the "Average Number of Rolls to obtain a Six on a Die", along with the average value. Include the average number of rolls your program calculates as a comment. Hints: Consider two repetition loops in your program. The outer repetition repeats the number of times to perform the experiment. The inner repetition repeats the single event of rolling a die an indeterminate number of times until a six is first observed. Import the random module and use the function randint(). Grading: Correct main (+4 points). Correct for-loop (+4 points). Correct result written as a comment (42 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Compare between the zero-point energy in the case of HO and PID

Answered: 1 week ago