This Python script calculates Body Mass Index (BMI) based on a person's height and weight. It then interprets the BMI to provide a classification ranging from underweight to clinically obese.
-
Make sure you have Python installed on your system.
-
Clone or download the repository.
-
Open a terminal or command prompt and navigate to the project directory.
-
Run the script by executing the following command:
python main.py
-
Follow the on-screen instructions to input your height (in meters) and weight (in kilograms).
-
The program will display your BMI and the corresponding classification.
main.py: The main Python script containing the BMI calculation and interpretation logic.README.md: This file, providing an overview of the BMI calculator and usage instructions.
Calculate BMI given height (in meters) and weight (in kilograms).
-
Parameters:
height(float): Height in meters.weight(float): Weight in kilograms.
-
Returns:
- float: Calculated BMI.
Interpret the BMI and provide a classification.
-
Parameters:
bmi(float): Calculated BMI.
-
Returns:
- str: BMI interpretation.
The main function to execute the BMI calculation and interpretation.
The script handles invalid input, ensuring that only numerical values for height and weight are accepted.