ChatDev/WareHouse/BMI Calculator_DefaultOrganization_20230918110521/bmi_calculator.py
2023-09-18 11:26:21 +05:00

9 lines
264 B
Python

'''
This file contains the BMICalculator class.
'''
class BMICalculator:
def calculate_bmi(self, weight, height):
if height <= 0:
raise ValueError("Height cannot be zero or negative.")
bmi = weight / (height ** 2)
return bmi