-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created bmi calculator function with no implementation
- Loading branch information
1 parent
0aaed33
commit fc397f2
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class BMIResult: | ||
bmi: float | ||
category: str | ||
risk_level: str | ||
|
||
|
||
def get_bmi( | ||
weight: float, | ||
height: float, | ||
) -> BMIResult: | ||
"""Calculate Body Mass Index (BMI) and return detailed classification information. | ||
BMI is calculated as weight (kg) divided by height (m) squared. | ||
Parameters | ||
---------- | ||
weight : float | ||
Weight in kilograms | ||
height : float | ||
Height in meters | ||
Returns | ||
------- | ||
BMIResult | ||
A dataclass containing: | ||
- bmi (float): The calculated BMI value | ||
- category (str): BMI category, one of: | ||
- 'underweight' (BMI < 18.5) | ||
- 'healthy' (BMI 18.5-24.9) | ||
- 'overweight' (BMI 25-29.9) | ||
- 'class 1 obesity' (BMI 30-34.9) | ||
- 'class 2 obesity' (BMI 35-39.9) | ||
- 'class 3 obesity' (BMI >= 40) | ||
- risk_level (str): Associated health risk level | ||
""" | ||
return |