PYTHON PROGRAMMING EXERCISES WITH ANSWERS
BOOK TITLE: A Practical Introduction to Python Programming Chapter 4 If statements EXERCISE AND SOLUTION """ Write a program that asks the user to enter a length in centimeters. If the user enters a negative length, the program should tell the user that the entry is invalid. Otherwise, the program should convert the length to inches and print out the result. There are 2.54 centimeters in an %% inch. """ """// T=eval(input('Enter the length in cm: ')) L= T/2.54 if T print('The length is invalid.') elif T>0: print('The length in inches is: ', L) //""" """ Ask the user for a temperature. Then ask them what units, Celsius or Fahrenheit, the temperature is in. Your program should convert the temperature to the other unit. The conversions are F =9/5(C+32) and C =5/9(F-32). """ """// T = eval(input('Enter the Temp...