Question: print( PROBLEM 1 ) total =0 print(Please enter 5 test grades (out of 100 ):) #TODO: FIX THE FOLLOWING RANGE r for i in range(










print(" PROBLEM 1 ") total =0 print("Please enter 5 test grades (out of 100 ):") \#TODO: FIX THE FOLLOWING RANGE r for i in range( 4): # The next two lines are separated into two statements \# with an empty input( ) statement because variables cannot \# be placed inside an input statement using the, separator print( "Test grade", (i+1), ">", end="") grade = int( input( ) ) total = total + grade print(" \ nTotal points earned is", total, "out of 500.") def problem2( ): ""This loop should repeat until the user types 'quit' to end the loop.""" print(" PROBLEM 2") choice =" count =0 \#TODO: FIX THE FOLLOWING CONDITION TO STOP ON "QUIT" while choice == "quit": count = count +1 print(" \ "This loop has iterated", count, "times.") print(" This loop has iterated", count, "times.") choice = input( "Would you like to repeat or quit? > ") print(" This loop ran", count, "times.") def problem3( ): "" "This loop should flip as long as the user types 'flip'. The code will then print the total number of heads and tails flipped."" print(" PR0BLEM 3") heads =0 tails =0 repeat = "flip" while repeat == "flip": print( ) coin = random. randrange( 2 ) if coin ==0: print("Heads") heads +=1 else: print("Tails") tails += 1 \#TOD0: FIX THE VARIABLE BEING ASSIGNED choice = input("Type 'flip' to flip the coin again ") print() print("Coin flip summary:") print("heads =", heads, "tails =", tails) 7677787980#==main=====problem1()problem2()problem3() Assignment Fix the following code in REPL and submit the weblink. - FORK and complete Fix the Loops G
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
