Question: # Miles to Kilometers miles = float ( input ( ' William , Please enter how many miles you want converted: ' ) ) #
# Miles to Kilometers
miles floatinputWilliam Please enter how many miles you want converted:
# Check if miles is negative and if so end program.
if miles :
printYou can not enter a negative number goodbye, William.
else:
milesToKilometers miles
printWilliam miles, 'Miles is equal to Kilometers: formatmilesToKilometersf "isn't that amazing!"
Add a loop to the above program such that the user gets three chances to
enter a valid value. If the user enters an invalid value more than three times in a row, the program should issue an error message and terminate
These condition apply : No use of
functions, list, a menu etc...break, quit, exit, sysexit, return,
continue, or any other shortcut ion NEVER allowed.
Please pay attention to the conditions above
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
