Write Program Prompts User Enter Length Feet Inches Outputs Equivalent Length Centimeters Q37154622

Write a program that prompts the user to enter a length in feetand inches and outputs the equivalent length in centimeters. If theuser enters a negative number or a nondigit number, throw andhandle an appropriate exception and prompt the user to enteranother set of numbers. Using Python


Solution


feet = input(“Enter feet: “)if(not feet.isnumeric()): print(“Input should be a positive number”)else: feet = float(feet) if(feet < 0): print(“Input should be a positive number”) else: inch

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.