mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-09-20 22:59:10 +03:00
9 lines
264 B
Python
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 |