From cd6dd2674a19075773eb5faf853e0ec1fd400a58 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Mon, 20 Nov 2023 08:45:12 -0600 Subject: [PATCH] day 3 --- day-03/bmi-calculator-2.py | 17 +++++++++++++++++ day-03/leap-year.py | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 day-03/bmi-calculator-2.py create mode 100644 day-03/leap-year.py diff --git a/day-03/bmi-calculator-2.py b/day-03/bmi-calculator-2.py new file mode 100644 index 0000000..8d66732 --- /dev/null +++ b/day-03/bmi-calculator-2.py @@ -0,0 +1,17 @@ +# Enter your height in meters +height = float(input()) +# Enter your weight in kilograms +weight = int(input()) + +bmi = weight / (height * height) + +if bmi < 18.5: + print(f"Your BMI is {bmi}, you are underweight.") +elif bmi < 25: + print(f"Your BMI is {bmi}, you have a normal weight.") +elif bmi < 30: + print(f"Your BMI is {bmi}, you are slightly overweight.") +elif bmi < 35: + print(f"Your BMI is {bmi}, you are obese.") +else: + print(f"Your BMI is {bmi}, you are clinically obese.") diff --git a/day-03/leap-year.py b/day-03/leap-year.py new file mode 100644 index 0000000..4815550 --- /dev/null +++ b/day-03/leap-year.py @@ -0,0 +1,15 @@ +# Which year do you want to check? +year = int(input()) + +# My solution (same as hers) +if year % 4 == 0: + if year % 100 == 0: + if(year % 400 == 0): + print(f"{year} is a Leap Year") + else: + print(f"{year} is NOT a Leap Year") + else: + print(f"{year} is a Leap Year") +else: + print(f"{year} is NOT a Leap Year") +