Question: So what I'm trying to do is have my python program re-prompt the user for a valid input after it finds an invalid input. Right

So what I'm trying to do is have my python program re-promptSo what I'm trying to do is have my python program re-prompt the user for a valid input after it finds an invalid input. Right now, it finds the invalid input but then just finishes the program. What can I do to get this to work?

na sa.py/Users/Alex/Documentsasa.py (3.6.2) # a program that prints the timed result of computers def mainO: #greeting print C"Below, you are going to input the timed results of the three computers... ") printO #input the timed results of the three computers while True: try: compl = float(input("Enter the timed result of computer 1: ")) except ValueError: print C"Invalid input") return main) Python 3.6.2 Shell RESTART: /Users/Alex/Documentsasa.py Below, you are going to input the timed results of the three computers... Enter the timed result of computer 1: i Invalid input Ln: 150 Col: 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!