Discuss / Python / 打卡同时交作业

打卡同时交作业

Topic source

#1 Created at ... [Delete] [Delete and Lock User]

# -*- coding: utf-8 -*-

height = input('请输入你的身高:')

height = float(height)

weight = input('请输入你的体重:')

weight = float(weight)

BMI = weight/(height**2)

print('你的身高是:%s \n 你的体重是:%s\n BMI指数是:%.2f' %(height,weight,BMI))

if BMI>32:

    print('OVERWEIGHT')

elif BMI>=28:

    print('FAT')

elif BMI >=25:

    print('littlefat')

elif BMI >=18.5:

    print('NORMAL')

else:

    print('Light weight')

 f:/work/L1_4.py

请输入你的身高:1.75

请输入你的体重:80.5

你的身高是:1.75 

 你的体重是:80.5

 BMI指数是:26.29

littlefat


  • 1

Reply