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
+ 0 comments # Enter your code here. Read input from STDIN. Print output to STDOUT import calendar import collections m, d, y = map(int, input().split()) wd = collections.defaultdict(list) wd[0].append('Monday'.upper()) wd[1].append('Tuesday'.upper()) wd[2].append('Wednesday'.upper()) wd[3].append('Thursday'.upper()) wd[4].append('Friday'.upper()) wd[5].append('Saturday'.upper()) wd[6].append('Sunday'.upper()) print(wd[calendar.weekday(y, m, d)][0])
+ 0 comments import calendar date = list(map(int, input().split())) day_of_week = calendar.weekday(date[2], date[0], date[1]) days_dict = { 0: "Monday", 1: "Tuesday", 2: "Wednesday", 3: "Thursday", 4: "Friday", 5: "Saturday", 6: "Sunday" } print(days_dict[day_of_week].upper())
+ 0 comments from calendar import weekday, day_name m, d, y = map(int, input().split()) print(day_name[weekday(y, m, d)].upper())
+ 0 comments from datetime import datetime date=input().split() day=datetime(int(date[2]),int(date[0]),int(date[1])) print(day.strftime("%A").upper())
+ 0 comments import calendar month, day, year = list(map(int, input().split())) print(list(calendar.day_name)[calendar.weekday(year, month, day)].upper())
Load more conversations
Sort 594 Discussions, By:
Please Login in order to post a comment