How many Centimeters in a Foot through Python

Posted in

How many Centimeters in a Foot through Python
vinaykhatri

Vinay Khatri
Last updated on December 23, 2024

    Here we have provided a Program in Python which can tell how many centimeters are there in the user entered a number (in feet). The program asks the user to enter feet and in return, the program tells the user how many centimeters are in that feet. This would be feet to centimeters converter.

    How many Centimeters in a Foot through Python Program

    try:
        feet = int(input("Enter Feet: "))
        cm = feet*30.48
        print("There are "+str(cm)+"cms in "+str(feet)+" feet" )
    except:
        print("Enter a valid number for feet")

    Output:

    Enter Feet: 20
    There are 609.6cms in 20 feet

    People are also reading:

    Leave a Comment on this Post

    0 Comments