How to code a BMI calculator.

preview_player
Показать описание
The code is in the comments.
Рекомендации по теме
Комментарии
Автор

Code:def calculate_bmi(weight, height):
bmi = weight / (height ** 2)
return bmi

weight = float(input("Enter your weight in kilograms: "))
height = float(input("Enter your height in meters: "))

bmi = calculate_bmi(weight, height)

print("Your BMI is:", bmi)

if bmi < 18.5:
print("You are underweight.")
elif 18.5 <= bmi < 25:
print("Your weight is normal.")
elif 25 <= bmi < 30:
print("You are overweight.")
else:
print("You are obese.")

Arrayc
visit shbcf.ru