Discuss / Python / 交作业

交作业

Topic source

KKKKKKKEM

#1 Created at ... [Delete] [Delete and Lock User]
在此插入代码

-- coding: utf-8 --

BMI指数测定

import os height=float(input("请输入你的身高(单位/米):\n")) weight=float(input("请输入你的体重(单位/千克):\n")) BMI=float(weight/(height*height)) print("您的BMI值是:%.2f"%BMI) if BMI<18.5: print("过轻") elif BMI<=25: print("正常") elif BMI<=28: print("过重") elif BMI<=32: print("肥胖") else: print ("严重肥胖") os.system("pause")

乱码怎么办


  • 1

Reply