猫史档案馆


BMI计算器出问题了,怎么改?

用户:呵呵123456789呵呵123456789查看:2 回复:3 评论:2 创建时间:2022-09-16T21:30:16


#开始进入Python的世界
float(a) = input('您的身高(m)?')
float(b) = (a * a)
float(c) = input('您的体重(kg)?')
float(d) = (c / b)
print(d)

如代码,求大神帮忙修一下


回复

上一页1 页 / 共 1下一页
水翎稞水翎稞

好奇怪的写法……

点赞0


评论


ZJY0923ZJY0923

height=input("你的身高是多少米")
height=float(height)
weight=input("你的体重是多少千克")
weight=float(weight)
bmi = weight/pow(height,2)
print(bmi)
if bim<=18.4:
    print("偏瘦")
elif bim<23.9:
    print("正常")
elif bim<27.9:
    print("过重")
elif bim<28:
    print("肥胖")






点赞0


评论


Eternal_BlueEternal_Blue

没必要写float的........

点赞0


评论