【发布时间】:2016-03-27 00:45:09
【问题描述】:
下面是我的代码:
def inForm():
name = requestString("What is your name?")
age = requestInteger("What is your age?")
height = requestInteger("What is your height?")
weight = requestInteger("What is your weight?")
print "Hello", name, "!", "You are", age,"years old!", "Your height
is", height, "cm", "and you weigh", weight, "kg"
我需要在这段代码中添加 BMI 计算,这是我的公式,BMI =weight/(height*height)
根据 BMI 显示这些消息:
你的体重严重不足,不到 15 岁
您从 15.0 到 16.0 体重严重不足
您从 16.0 到 18.5 体重过轻
你的体重在 18.5 到 25 之间是正常的
你从 25 岁到 30 岁超重
您在 30 到 35 岁之间属于中度肥胖
你从 35 岁到 40 岁严重肥胖
你 40 岁以上严重肥胖
我似乎无法弄清楚,我该怎么做?
提前致谢!
【问题讨论】: