#!/usr/bin/env python2
#-*- coding:utf-8 -*-
__author__ = 'jalright'
"""
使用python实现万年历
"""
def is_leap_year(year):
"""
判断是否是闰年,返回boolean值
"""
if year/4==0 and year/400 !=0:
return True
elif year/100 == 0 and year/400 ==0 :
return True
else:
return False
def getMonthDays(year,month):
"""
获取指定年月的月份有多少天
"""
days = 31 #31天居多,设置为默认值
if month == 2 : #2月份要判断是否是闰年
if is_leap_year(year):
days=29
else:
days=28;
elif month in [4,6,9,11]: #判断小月,只有30天
days=30
return days
def getTotalDays(year,month):
"""
获取199