Python 体重分类程序:判断偏瘦、中等、肥胖
weight = input('请输入体重(单位:斤):')
try: weight = int(weight) if weight < 0 or weight > 120: print('非法输入') elif weight <= 80: print('变成了', weight+81, '斤,属于偏瘦') elif weight <= 120: print('变成了', weight+81, '斤,属于中等') else: print('变成了', weight+81, '斤,属于肥胖') except: print('非法输入')
原文地址: https://www.cveoy.top/t/topic/oFdv 著作权归作者所有。请勿转载和采集!