计算哪一年哪个月份有多少天

根据年月,查当月共有多少天

import calendar
def get_month_days(year, month):
    number = calendar.monthrange(year, month)
    return number[1]
 num = get_month_days(2018, 5)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/lxq_9532/article/details/83623212