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
|
656 Discussions
|
Please Login in order to post a comment
The calendar module seems super handy for generating quick and easy text-based calendars! Bc game sign in
import calendar day = 5 month = 8 year = 2015 day_index = calendar.weekday(year,month,day) day_name = calendar.day_name[day_index].upper() print(day_name)
Here's my code:
import calendar month,date,year=(int(i) for i in input().split()) x = calendar.weekday(year,month,date) print(calendar.day_name[x].upper())
My approach for the problem. Using the calendar we can reduce our time and number of lines to code and futhermore leverage the inbuilt functions available to us.
import calendar
month , date , year =list(map(int,input().split())) x = calendar.weekday(year,month,date) print(calendar.day_name[x].upper())