Python 体重判断程序:输入体重,判断体型
weight = input('请输入体重(单位:斤):') try: weight = float(weight) if weight < 0 or weight > 120: print('输入的体重不合法!') elif weight <= 80: print('变成了{:.0f}斤'.format(weight+81)) elif weight <= 120: print('中等') else: print('肥胖') except ValueError: print('输入的体重不合法!')
原文地址: https://www.cveoy.top/t/topic/oFdB 著作权归作者所有。请勿转载和采集!