From 3dea17bf1b3732baa3e6434a6482b56d540478e7 Mon Sep 17 00:00:00 2001 From: Ansh Meshram <141160800+AnshMeshram@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:43:48 +0530 Subject: [PATCH] Create Bmi calculator.py --- Bmi calculator.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Bmi calculator.py diff --git a/Bmi calculator.py b/Bmi calculator.py new file mode 100644 index 00000000..0d7f3b66 --- /dev/null +++ b/Bmi calculator.py @@ -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.")