-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmi.py
More file actions
22 lines (18 loc) · 745 Bytes
/
bmi.py
File metadata and controls
22 lines (18 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Get to know your body mass index
print(":BMI Calculator:")
try:
weight = float(input("\nEnter your weight (kg): "))
height = float(input("\nEnter your height (m): "))
bmi = weight / height ** 2
print(f"\nYour BMI is: {bmi:.2f}")
if bmi >= 16 and bmi <= 18.4:
print("\nYour current weight is under the regular value for your height.")
elif bmi >= 18.5 and bmi <= 24.9:
print("\nYour current weight is a normal value for your height.")
elif bmi >= 25 and bmi <= 50:
print("\nYour current weight is over the regular value for your height.")
else:
print("\nThis BMI doesn't seem correct.")
print("\nPlease, try again.")
except:
print("\nPlease, enter a valid value.")