Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Someone help me please Solve these looping problems three. For each problem, create a new Python file. print (You rolled . ., roll) Percentage is

Someone help me please

image text in transcribed
Solve these looping problems three. For each problem, create a new Python file. print ("You rolled . .", roll) Percentage is 0.16833333333333333 If starter code is provided below, then copy the starter code into zell again = input ("Want to roll again? ") Hum of times 6 was rolled 99 the Python file. if roll again == "y percentage is 0.165 break Note that some starter code given has syntax errors or other print (Goodbye ! ) bugs. Fix these to get the program working (note there are several possible Problem #3 - Requirements: solutions). Feel free to - Simulate rolling a 6-sided die. This time do not ask the user if change code as you would like, as long as you still meet all they want to roll requirements. again. Instead, simply roll the die 600 times. This is best done by using a for Problem #1 - Requirements. loop with the range function to loop 600 times. Do not print the Print "hello" in a while loop. result of each - Ask user if they want to quit (handle both upper-case and lower- roll. Instead, keep a count of how many times each side was case Y/N yin). rolled. Print "Goodbye" at end of program. - After looping 600 times, print how many times each side was Starter Code: rolled, along with while True a percentage. See sample output below. print ( "Hello!") - (Rolling 600 is a good number because we can expect each side quit = input ("Want to quit? Enter Y or N: ") to be rolled if quit == wy" somewhere close to 100 times) -Print "Goodbye" at end of program. break See sample output below. print ( ' Goodbye! ' ) -Simulate rolling a 6-sided die. Print number that was rolled (1, 2, Sample output: 3, 4, 5, or 6) Num of times 1 was rolled 92 Percentage is 0.15333333333333332 - Do this in a loop. Ask user if want to roll again (Y or N). Handle both upper case / Num of times 2 was rolled 94 Percentage is 0. 15666666666666668 lower case. Num of times 3 was rolled 115 - Print "Goodbye" at end of program. Percentage is 0. 19166666666666668 Starter Code: Num of times 4 was rolled 99 roll = random. randint (0, 6 Percentage is 0. 165 while True Num of times 5 was rolled 101

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