name=input('please enter your name:')
weight=int(input('please enter your weight(kg):'))
height=float(input('please enter your height(m):'))
bmi=weight/(height*height)
if bmi>32:
b='severe obesity'
elif bmi>28:
b='obesity'
elif bmi>25:
b='too heavy'
elif bmi>18.5:
b='noraml'
else:
b='too light'
print('Dear %s,your BMI is:%s,your health status is:%s'%(name,'%.2f'%bmi,b))
你在眉梢
-- coding: utf-8 --
name=input('please enter your name:') weight=int(input('please enter your weight(kg):')) height=float(input('please enter your height(m):')) bmi=weight/(height*height) if bmi>32: b='severe obesity' elif bmi>28: b='obesity' elif bmi>25: b='too heavy' elif bmi>18.5: b='noraml' else: b='too light' print('Dear %s,your BMI is:%s,your health status is:%s'%(name,'%.2f'%bmi,b))