Python TextCalendar Module : weekday() method
weekday() method
The weekday() method is used to returns the day of the week (0 is Monday) for year (1970–...), month (1–12), day (1–31).
Syntax:
weekday(year, month, day)
Parameters:
Name | Description | Required / Optional |
Type |
---|---|---|---|
year | Year for which the calendar should be generated. | Required | Number |
month | month for which the calendar should be generated. | Required | Number |
day | day for which the calendar should be generated. | Required | Number |
Example of weekday() method
import calendar
print(calendar.weekday(2016, 5, 15))
Output:
6
Previous: leapdays()
Next: weekheader()
Test your Python skills with w3resource's quiz
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://198.211.115.131/python/module/calendar/weekday.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics