#!/usr/local/bin/python3 class Person: def __init__(self, weight, height): self.weight = weight self.height = height def bmi(self): return BMI(self.weight, self.height) class BMI: def __init__(self, weight, height): h = height / 100 self.value = weight / (h**2) def describe(self): bmi = self.value print('---') print('BMI =', bmi) if bmi < 18.5: print('slender') elif bmi < 25.0: print('normal') elif bmi < 30.0: print('slightly fat') elif bmi < 35.0: print('very fat') else: print('very very fat') person = Person(65, 170) print(person) bmi = person.bmi().value print(bmi) person.bmi().describe()