Jump to content

Day of the week: Difference between revisions

(→‎{{header|Ruby}}: removed 1.8 code, promoted 1.9 code.)
Line 1,986:
 
=={{header|Python}}==
<lang python>importfrom datetime import date
 
for year in range(2008, 2122):
def yuletide():
day = date(year, 12, 25)
sunday = 6
if day.weekday() == 6:
days = (day.strftime('%d %b %Y') for day in (datetime.date(year, 12, 25) for year in range(2008,2122)) if day.weekday() == sunday)
print(day.strftime('%d %b %Y')</lang>
print '\n'.join(days)
 
yuletide()</lang>
{{out}}
<pre>25 Dec 2011
Cookies help us deliver our services. By using our services, you agree to our use of cookies.