‘’’
定义一个函数,用于求2017年1月到month前一个月的总天数
‘’’
def dayNums(month):
year = 2017
days = [31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
totalDays = days[month-2]
print('{}年1月到{}月前一个月的总天数是{}'.format(year, month, totalDays))
dayNums(5)