Looks like my first if statement doesn't work and always goes yes. I would like to provide choice in my calculation program, whether user uses metric system or not.
Anything works fine after that. Appreciate your support.
def bmi_calc():
question = input('Do you use metric system?: Y/N> ')
metric_system = None
if question == 'Y' or 'y' or 'yes':
metric_system = True
height = float(input('Enter your height in meters: '))
weight = float(input('Enter your weight in kilograms: '))
elif question == 'N' or 'n' or 'no':
metric_system = False
height = float(input('Enter your height in feets: '))
weight = float(input('Enter your weight in pounds: '))
else:
'incorrect answer'
bmi_calc()
bmi = None
if metric_system == True:
bmi = weight / (height ** 2)
elif metric_system == False:
bmi = weight / (height ** 2) * 703
print(f'Your body mass index is {bmi:.2f}')