How to calculate our BMI?

  • Anyone know the method to calculate BMI.

  • The Body Mass Index (BMI) is calculated using the following formula:

    BMI = weight (kg) / (height (m))^2

    So, you divide your weight in kilograms by the square of your height in meters.

    If you're using pounds and inches, you can use the following formula:

    BMI = [weight (lbs) / (height (in))^2] * 703

    This formula includes the conversion factor of 703 to adjust for the metric system.

    python code:

    def calculate_bmi(weight_kg, height_m):
        bmi = weight_kg / (height_m**2)
        return bmi
    weight_kg = float(input("Enter your weight in kg: "))
    height_m = float(input("Enter your height in meters: "))
    bmi = calculate_bmi(weight_kg, height_m)
    print("Your BMI is: ", round(bmi, 2))

  • Thanks for your reply Ye Shiwei. I will calculate my BMI based on your information.

Log in to reply