We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Date and Time
- Calendar Module
- Discussions
Calendar Module
Calendar Module
Sort by
recency
|
689 Discussions
|
Please Login in order to post a comment
import calendar import datetime ****month,day,years=map(int,input().split()) ind=datetime.date(years,month,day).weekday() print(calendar.day_name[ind].upper())
Maybe my solution could inspire someone :
I have noticed with print() that weekday() return a number corresponding to the day in a week. (Monday = 0, Tuesday = 1, Wednesday = 2 ... Sunday = 6).
So I have created a dictionnary and use it with the function calendar.weekday() to return the good day name :