条件判断

题目:

廖雪峰python3练习题三-LMLPHP

答案:

 #!/usr/bin/env python3
#-*- coding:utf-8 -*- heigth = 1.75
weigth = 80.5 bim = weigth / (heigth * heigth)
print(bim) if bim < 18.5:
print('过轻')
elif bim > 18.5 and bim < 25:
print('正常')
elif bim > 25 and bim < 28:
print('过重')
elif bim > 28 and bim < 32:
print('肥胖')
elif bim > 32:
print('严重肥胖')
05-11 20:43