您的位置:首页 > 编程语言 > Python开发

python中获得某月有多少天的函数

2015-10-14 16:44 381 查看
monthrange(year, month)

Returns weekday of first day of the month and number of days in month, for the specified year and month.

这个函数就是,返回星期的数量和本月的天数,需要引用calendar

import calendar

monthrange(2002,1)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: