some progress
This commit is contained in:
parent
5c9abff73f
commit
f92f5ef7f6
11 changed files with 235 additions and 4 deletions
20
test/ruby/24.in
Normal file
20
test/ruby/24.in
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
def calculate_bmi(weight, height):
|
||||
bmi = weight / (height ** 2)
|
||||
|
||||
if bmi < 18.5:
|
||||
category = "Underweight"
|
||||
else:
|
||||
if bmi < 25:
|
||||
category = "Normal"
|
||||
else:
|
||||
if bmi < 30:
|
||||
category = "Overweight"
|
||||
else:
|
||||
category = "Obese"
|
||||
|
||||
return f"BMI: {bmi}, Category: {category}"
|
||||
|
||||
# Test
|
||||
print(calculate_bmi(70, 1.75))
|
||||
print(calculate_bmi(90, 1.80))
|
||||
print(calculate_bmi(50, 1.65))
|
||||
Loading…
Add table
Add a link
Reference in a new issue