Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help you may need to have 6 counter variables. After the looping, print how many times each side was rolled, along with a percentage.

Need help

image text in transcribed
you may need to have 6 counter variables. After the looping, print how many times each side was rolled, along with a percentage. Print "Goodbye" at end of program. Create a new Python file and copy in the code from the previous problem. Change the new code such at: Instead of using 6 counter variables, create a list of 6 integers. Each element will represent the count for each side. Set each element in the list to 0. Each time you roll the die in the loop, add one to the appropriate element in the list. When finished looping and you print the output as shown below, this time use a loop to loop through the list of counters, printing each counter and calculate the percentage to print the percentage. Reminder of Sample output: Num of times 1 was rolled 92 Percentage is 0. 15333333333333332 Num of times 2 was rolled 94 Percentage is 0. 15666666666666668 Num of times 3 was rolled 115 Percentage is 0. 19166666666666668 Num of times 4 was rolled 99 Percentage is 0. 165 Num of times 5 was rolled 101 Percentage is 0. 16833333333333333 Num of times 6 was rolled 99 Percentage is 0. 165

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions