Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions BMI calculator/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Hello, this is a BMI calculator

#we're taking the input from user
weight = float(input("Please enter your weight (kg): "))
height = float(input("Please enter your height (m): "))

#formula to get the bmi
bmi = weight / height ** 2

#now checking the bmi
if bmi < 18.5:
print("You're underweight!")
elif 18.5 <= bmi <= 24.9:
print("Your weight is normal!")
elif 25 <= bmi <= 29.9:
print("You're overweight")
else:
print("You're obese")