# Python program to convert Centimeter to Inches
# taking input
num = float(input("Enter the distance measured in centimeter : "))
# converting from cms to inches
""" 1 inch = 2.54 centimeters"""
inc = num/2.54
# printing the result
print("Distance in inch : ", inc)
Output
First run:
Enter the distance measured in centimeter : 245
Distance in inch : 96.45669291338582
Second run:
Enter the distance measured in centimeter : 54
Distance in inch : 21.25984251968504
Third run:
Enter the distance measured in centimeter : 2.54
Distance in inch : 1.0
Python code to convert Centimeter to Inches
Output
need an explanation for this answer? contact us directly to get an explanation for this answer