Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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-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: 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started