You are on page 1of 1

# cara perhitungan Body Mass index dengan python

# Give the first number as user input using float(input()) and store it in a
variable
gvn_heigt = float(input("masukkan tinggi dalam Meter (ex: 1.81) = "))
# Give the second number as user user input float(input()) and store it in another
variable
gvn_weigt = float(input("masukkan berat badan = "))
# Calculate the BMI value using the above given mathematical formula and
# store it in another variable
Bmi_vlue = gvn_weigt/(gvn_heigt**2)
print("The BMI for the above given values = ", format(Bmi_vlue))
print("Healt status of a person for the above obtained BMI = ",end="")
# Check if the obtained BMI value is less tha 18.5 using if condition statement .
# if is True, Print "The person is underweight".
if (Bmi_vlue < 18.5):
print("The person is Underweight")
# Check if the obtained BMI is greater than or equal to 18.5 and less than 24.9
using
# elif conditional statement
# if it is True, Print "The person is Healthy".
elif (Bmi_vlue >= 18.5 and Bmi_vlue < 24.9) :
print("The person is Healthy")
# Check if the obtained BMI is greater than or equal to 24.9 and less than 30 using
# elif condition statement
# if it is True, Print "The person is everweight".
elif (Bmi_vlue >= 24.9 and Bmi_vlue < 30):
print("The person is Overweight")
# Check If the obtained BMI is greater than or equal to 30 using
# elif conditional statement.
# If it is True, Print "The person is Suffering from Obesity"
elif (Bmi_vlue >= 30):
print("The person is Suffering from Obesity")

You might also like