Oct-12-2023, 01:39 PM
from calendar import Calendar from datetime import date year, month, *_ = date.today().timetuple() cal = Calendar() dates = [dt.strftime('%a %d %B %Y') for dt in cal.itermonthdates(year, month) if dt.month == month] print(dates)
Output:['Sun 01 October 2023', 'Mon 02 October 2023', 'Tue 03 October 2023', 'Wed 04 October 2023', 'Thu 05 October 2023', 'Fri 06 October 2023', 'Sat 07 October 2023', 'Sun 08 October 2023', 'Mon 09 October 2023', 'Tue 10 October 2023', 'Wed 11 October 2023', 'Thu 12 October 2023', 'Fri 13 October 2023', 'Sat 14 October 2023', 'Sun 15 October 2023', 'Mon 16 October 2023', 'Tue 17 October 2023',
'Wed 18 October 2023', 'Thu 19 October 2023', 'Fri 20 October 2023', 'Sat 21 October 2023', 'Sun 22 October 2023', 'Mon 23 October 2023', 'Tue 24 October 2023', 'Wed 25 October 2023', 'Thu 26 October 2023', 'Fri 27 October 2023', 'Sat 28 October 2023', 'Sun 29 October 2023', 'Mon 30 October 2023', 'Tue 31 October 2023']
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs