Discuss / Python / 作业

作业

Topic source

屾屾丶

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

n=input('您叫什么名字?')

h=float(input('您的身高是多少米?'))

w=float(input('您的体重是多少kg?'))

bmi=w/h**2

if bmi<18.5:

print('亲爱的%s,您的体重过轻。'% n)

elif bmi<25:

print('亲爱的%s,您的体重正常。'% n)

elif bmi<28:

print('亲爱的%s,您的体重过重。'% n)

elif bmi<32:

print('亲爱的%s,您的体重为肥胖。'% n)

else:

print('亲爱的%s,您的体重严重肥胖。'% n)


  • 1

Reply