

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is itermonthdates() in python?
itermonthdates() method will return all days for the month and all days before the start of the month or after an end of the month that are required to get a complete week.
Example
import calendar #assigning variable to the calendar variable = calendar.Calendar() for day in variable.itermonthdates(2019, 5): print(day)
Output
2019-04-29 2019-04-30 2019-05-01 2019-05-02 2019-05-03 2019-05-04 2019-05-05 2019-05-06 2019-05-07 2019-05-08 2019-05-09 2019-05-10 2019-05-11 2019-05-12 2019-05-13 2019-05-14 2019-05-15 2019-05-16 2019-05-17 2019-05-18 2019-05-19 2019-05-20 2019-05-21 2019-05-22 2019-05-23 2019-05-24 2019-05-25 2019-05-26 2019-05-27 2019-05-28 2019-05-29 2019-05-30 2019-05-31 2019-06-01 2019-06-02
Important to remember
look into the output that calendar shows starts the previous month's date and ends with the after month date.
- Related Questions & Answers
- What is immutable in Python?
- What is @ operator in Python?
- What is iterweekdays() in python?
- What is itermonthdays2() in python?
- What is filter() in python?
- What is Tick in Python?
- What is TimeTuple in Python?
- What is Exception in Python?
- What is CGI in Python?
- What is Pandas in python?
- What is unexpected indent in Python?
- What is exception handling in Python?
- What is zfill() method in Python?
- What is a namespace in Python?
- What is __init__.py in Python?
Advertisements