Day of the week of Christmas and New Year: Difference between revisions
(Created page with "{{Draft task}} ;Task: <br> Show on this page that what weekdays will Christmas ans New Year? =={{header|Python}}== <lang python> iimport datetime weekDays = ("Monday","Tuesd...") |
m (CalmoSoft moved page What weekdays will Christmas ans New Year to What weekdays will Christmas and New Year) |
||
(No difference)
|
Revision as of 09:13, 24 November 2021
Day of the week of Christmas and New Year is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
- Task
Show on this page that what weekdays will Christmas ans New Year?
Python
<lang python> iimport datetime
weekDays = ("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday") thisXMas = datetime.date(2021,12,25) thisXMasDay = thisXMas.weekday() thisXMasDayAsString = weekDays[thisXMasDay] print("This year's Christmas is on a {}".format(thisXMasDayAsString))
nextNewYear = datetime.date(2022,1,1) nextNewYearDay = nextNewYear.weekday() nextNewYearDayAsString = weekDays[nextNewYearDay+1] print("Next new year is on a {}".format(nextNewYearDayAsString)) </lang>
- Output:
This year's Christmas is on a Saturday Next new year is on a Sunday