Skip to content

Instantly share code, notes, and snippets.

@Priler
Created August 27, 2021 08:19
Show Gist options
  • Save Priler/5ca1b34a22b115d23f98a214dcd0c7aa to your computer and use it in GitHub Desktop.
Save Priler/5ca1b34a22b115d23f98a214dcd0c7aa to your computer and use it in GitHub Desktop.
height = float(input("Введите свой рост (см): "))
weight = float(input("Введите свой вес (кг): "))
BMI = float("{0:.2f}".format(weight / ((height / 100) * (height / 100))))
print(f"Ваш текущий ИМТ равен {BMI}")
if(BMI > 40):
print("Ожирение III степени")
elif(BMI >= 35):
print("Ожирение II степени")
elif(BMI >= 30):
print("Ожирение I степени")
elif(BMI >= 25):
print("Избыточный вес")
elif(BMI >= 18.5):
print("Нормальный вес")
else:
print("Недостаточный вес")
@rasputyashka
Copy link

BMI = float("{0:.2f}".format(weight / (height/100) ** 2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment