ChatDev/WareHouse/BMI Calculator_DefaultOrganization_20230918110521/bmi_calculator.py

9 lines
264 B
Python
Raw Normal View History

2023-09-18 09:26:21 +03:00
'''
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