Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. diceAverage Write a value-returning function without parameter that simulates rolling a dice (with six numbers) for 1000 times and then calculates and returns the

image text in transcribed

3. diceAverage Write a value-returning function without parameter that simulates rolling a dice (with six numbers) for 1000 times and then calculates and returns the average of all numbers rolled. Use the randint function of the random module for rolling the dice 2 o Call the function three times. Is the average always the same? o Challenges: Use a parameter for the number of repetitions to make your function more flexible or use a parameter for the highest number of the dice, or try both Tips Use the randint() function from the Python random module random.randint(a, b) Return a random integer N such that a

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

Students also viewed these Databases questions

Question

=+ What would it look like? Who should deliver it?

Answered: 1 week ago