Friday, September 5, 2025
HomeLanguagesPython Program to Convert cm to Feet and Inches

Python Program to Convert cm to Feet and Inches

Python program to convert a given height in centimeters to feet and inches; In this tutorial, you will learn how to convert height in cm to feet and inches.

Python Program to Convert cm to Feet and Inches

Let’s use the following algorithm to write a python program to convert the cm(centimeter) to inches, feet:

  • Python program to convert height centimeters to inches.
  • Python program to convert height centimeters to feet.

Python program to convert height centimeters to inches

See the following steps and write a python program to accept the height in cm and convert it into inches:

  • Take the input from user by using python input() function.
  • Convert the height in centimeters into inches.
  • Print the length in 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

Python program to convert height centimeters to feet

See the following steps and write a python program to accept the height in cm and convert it into feet:

  • Take the input from user by using python input() function.
  • Convert the height in centimeters into feet.
  • Print the length in 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 Programs

RELATED ARTICLES

Most Popular

Dominic
32265 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11864 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6703 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS