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
|
698 Discussions
|
Please Login in order to post a comment
import calendar month_str, day_str, year_str = input().split() month, day, year = int(month_str), int(day_str), int(year_str) cale=calendar.weekday(year, month, day) day_name=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] print(day_name[cale].upper())
In line second u can use.. month, day, year=list(map(int, input().split())) for sorter code
import calendar
month, day, year = map(int, input().split())
print(calendar.day_name[calendar.weekday(year, month, day)].upper())
Use following code;
import calendar lis = list(map(int, input().split())) d =calendar.weekday(lis[2],lis[0],lis[1]) print(calendar.day_name[d].upper())
The calender.weekday takes parameter as (Y, M, D) not (Y, D,M)
08 05 2015 was actually "FRIDAY", but the question needs answer "WEDNESDAY"