programming-examples/python/_Basics/Convert height (in feet and inches) to centimeters.py
2019-11-15 12:59:38 +01:00

8 lines
204 B
Python

print("Input your height: ")
h_ft = int(input("Feet: "))
h_inch = int(input("Inches: "))
h_inch += h_ft * 12
h_cm = round(h_inch * 2.54, 1)
print("Your height is : %d cm." % h_cm)