month = int(input('请输入一个表示月份的数字(1~12):'))

if month == 1: print('Jan') elif month == 2: print('Feb') elif month == 3: print('Mar') elif month == 4: print('Apr') elif month == 5: print('May') elif month == 6: print('Jun') elif month == 7: print('Jul') elif month == 8: print('Aug') elif month == 9: print('Sep') elif month == 10: print('Oct') elif month == 11: print('Nov') elif month == 12: print('Dec') else: print('输入的数字不在1~12范围内')

Python 程序:月份数字转换为英文缩写

原文地址: https://www.cveoy.top/t/topic/o8A1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录