Discuss / Python / 作业

作业

Topic source
在此插入代码

!/usr/bin/env python3

-- coding: utf-8 --

height=float(input('plase enter your height (M) : ')) weight=float(input('plase enter your weight (KG): ')) BMI=weight/(height*height) Str = '正常' if BMI<=18.5: Str='过轻' elif BMI<=25: Str='正常' elif BMI<=28: Str='过重' elif BMI<=32: Str='肥胖' else: Str='严重肥胖' print('你的BMI指数是:%.1f'%BMI,'属于%s'%Str)


  • 1

Reply