Python Program to Convert cm to Feet and Inches

Python program to convert cm to feet and inches; Through this tutorial, i am going to show you how to convert cm to feet and inches in python.

In this tutorial, i will write some python programs to convert a human height given in feet and inches to centimeters.

Python Program to Convert cm to Feet and Inches

  • Write a python program to convert height centimeters to inches
  • Write a python program to convert height centimeters to feet

Write a python program to convert height centimeters to inches

#take input from user
cm=int(input("Enter the height in centimeters:"))
#convert centimeter to inche
inches=0.394*cm
#print result
print("The length in inches",round(inches,2))

Output

Enter the height in centimeters: 167
The length in inches 65.8

Write a python program to convert height centimeters to feet

#take input from user
cm=int(input("Enter the height in centimeters:"))
#convert centimeter to feet
feet=0.0328*cm
#print result
print("The length in feet",round(feet,2))

Output

Enter the height in centimeters: 167
The length in feet 5.48

Recommended Python Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published.