【Python教程-廖雪峰】条件判断

 文章来自:

https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/001431675624710bb20e9734ef343bbb4bd64bcd37d4b52000

仅供交流学习,欢迎指导。

-----------------------------------------------------------------

用程序实现了 多条件 if elif 判断BMI指标问题

weight = int(input('请输入体重:') )
if weight < 18.5:
    print('过轻')
elif weight >= 18 and \
	weight <25:
    print('正常')

elif weight >= 25 and \
	weight <28:
    print('过胖')
elif weight >= 28 and \
	weight <32:
    print('肥胖')
elif weight >= 32:
    print('严重肥胖')

猜你喜欢

转载自blog.csdn.net/leiwangzhongde/article/details/82904630
今日推荐