Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedSo 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

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions