根据年月,查当月共有多少天
import calendar
def get_month_days(year, month):
number = calendar.monthrange(year, month)
return number[1]
num = get_month_days(2018, 5)
根据年月,查当月共有多少天
import calendar
def get_month_days(year, month):
number = calendar.monthrange(year, month)
return number[1]
num = get_month_days(2018, 5)