在此插入代码
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)
Sign in to make a reply
重度潜水鲸
!/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)