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)
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)
相关文章推荐
- python文件操作模块glob
- <LeetCode><Easy>257BinaryTreePaths (深度优先搜索)(列表深拷贝)
- wx.Timer来设置定时事件(绑定定时器)
- python-面向对象(指数对象举例)
- LeetCode----Gray Code
- 【python】通讯录制作
- <LeetCode><Easy>242Valid Anagram (排序)
- 理解 python 装饰器
- python 登录验证
- <LeetCode><Easy>258Add Digits
- <LeetCode><Easy>263 Ugly Number (因式分解)
- python安装-ubuntu之第一篇
- 操作RPM和DEB包的PYTHON模块
- Python循环语句之break与continue的用法
- python2.7安装
- Python实现的内存表
- python flask 部署
- python-web.py-api文档
- Python编程中的for循环语句学习教程
- python基础学习笔记-正则表达式