python3-娱乐练习
name = input("请输入名字:")
Gender = input("请输入性别:")
height = int(input('请输入身高:'))
strong = int(input('请输入体重(公斤):'))
names = """
----- %s 的身高体重信息------
姓名:%s
性别:%s
身高:%s
体重为(公斤):%s
-----------end------------
""" %(name,name,Gender,height,strong)
print(names.strip())
if Gender == "男":
BIM = (strong/height**2)*10000
print("你的BIM指数为:","%.1f"%BIM)
if BIM < 18.5:
print('过轻')
elif BIM >= 18.5 and BIM <= 25:
print('正常')
elif BIM >= 25 and BIM <= 28:
print('过重')
elif BIM >= 28 and BIM <= 32:
print('肥胖')
elif BIM >= 32:
print('严重肥胖')
else:
print('过度严重肥胖')
elif Gender == "女":
BIM2 = (strong/height**2)*10000
print("你的BIM指数为:","%.1f" % BIM2)
if BIM2 < 18.5:
print('过轻')
elif BIM2 >= 18.5 and BIM2 <= 25:
print('正常')
elif BIM2 >= 25 and BIM2 <= 28:
print('过重')
elif BIM2 >= 28 and BIM2 <= 32:
print('肥胖')
elif BIM2 >= 32:
print('严重肥胖')
else :
print('过度严重肥胖')
else:
print("不男不女你就是个太监")