From 681c239d72d385e637c8cc9242e1f280b6896646 Mon Sep 17 00:00:00 2001 From: lenish Date: Tue, 4 Feb 2020 13:55:44 +0530 Subject: [PATCH] BMI with class --- 03_bmi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 03_bmi.py diff --git a/03_bmi.py b/03_bmi.py new file mode 100644 index 0000000..acbdd07 --- /dev/null +++ b/03_bmi.py @@ -0,0 +1,13 @@ +class Mybmi: + height=float(input("Enter the height in metres")) + weight=int(input("Enter the weight in kilograms")) + bmi=weight/(height*height) + print("The BMI of the user",bmi) + if bmi<=15: + print("The user is under weight") + elif (bmi>15 and bmi<=20): + print("The user is normal") + else: + print("obese") +if __name__ == '__main__': + a = Mybmi() \ No newline at end of file