Question: - Print hello in a while loop. - Ask user if they want to quit ( handle both upper - case and lower - case
Print hello in a while loop.
Ask user if they want to quit handle both uppercase and lowercase YN yn
Print Goodbye at end of program.
Starter Code:
while True
printHello
quit inputWant to quit? Enter Y or N:
if quit Y
break
printGoodbye
Problem # Requirements:
Simulate rolling a sided die. Print number that was rolled or
Do this in a loop.
Ask user if want to roll again Y or N Handle both upper case lower case.
Print Goodbye at end of program.
Starter Code:
roll random.randint
while True
printYou rolled roll
rollagain inputWant to roll again?
if rollagain Y
break
printGoodbye
Problem # Requirements:
Simulate rolling a sided die. This time do not ask the user if they want to roll
again. Instead, simply roll the die times. This is best done by using a for
loop with the range function to loop times. Do not print the result of each
roll. Instead, keep a count of how many times each side was rolled.
After looping times, print how many times each side was rolled, along with
a percentage. See sample output below.
Rolling is a good number because we can expect each side to be rolled
somewhere close to times
Print Goodbye at end of program.
See sample output below.
No starter code given. Write this from scratch
Sample output:
Num of times was rolled
Percentage is
Num of times was rolled
Percentage is
Num of times was rolled
Percentage is
Num of times was rolled
Percentage is
Num of times was rolled
Percentage is
Num of times was rolled
Percentage is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
