class Input:
def promptMessage(self,name,measure):
self.name = name
while True:
try:
num = int(input("Please Enter Your {} in {} ".format(name,measure)))
except ValueError:
print("Please enter a number")
else:
break
return num
class Person:
def __init__(self):
input = Input()
weight = input.promptMessage('weight','Kilo')
height = input.promptMessage('height','Kilo')
def __str__(self):
return "Your weight Is {} and your height {}".format(weight,height)
class BMI:
def __init__(self,jack):
result = jack.hieght
def __str__(self):
return result
jack = Person()
bmiCal = BMI(jack)
can someone please explain how I can get the height and weight attributes inside the Bmi object
I have had experience with java but in java I could easily pass one object inside another and use there attributes and even edit them