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
16 changes: 16 additions & 0 deletions Bmi calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# asking for input from the users
the_height = float(input("Enter the height in cm: "))
the_weight = float(input("Enter the weight in kg: "))
# defining a function for BMI
the_BMI = the_weight / (the_height/100)**2
# printing the BMI
print("Your Body Mass Index is", the_BMI)
# using the if-elif-else conditions
if the_BMI <= 18.5:
print("Oops! You are underweight.")
elif the_BMI <= 24.9:
print("Awesome! You are healthy.")
elif the_BMI <= 29.9:
the_print("Eee! You are over weight.")
else:
print("Seesh! You are obese.")