|
25 | 25 | locale_calendar = calendar.LocaleTextCalendar(locale="de_DE.UTF-8") |
26 | 26 | locale_calendar.prmonth(2024, 1) |
27 | 27 |
|
28 | | -"""Print weekday number values in order with Sunday (6) as the first day of the week""" |
| 28 | +"""Print weekday number values in order with Sunday (6) as the first |
| 29 | +day of the week""" |
29 | 30 |
|
30 | 31 | for day_number in text_calendar.iterweekdays(): |
31 | 32 | print(day_number) |
32 | 33 |
|
33 | | -"""Print all dates of January 2024 calendar as strings including dates from previous and following months |
34 | | -needed to complete the first and last weeks""" |
| 34 | +"""Print all dates of January 2024 calendar as strings including dates from |
| 35 | +previous and following months needed to complete the first and last weeks""" |
35 | 36 |
|
36 | 37 | for day in text_calendar.itermonthdates(2024, 1): |
37 | 38 | day.strftime("%m/%d/%Y") |
38 | 39 |
|
39 | | -"""Print all dates of January 2024 calendar as numerical days of the month including dates from previous |
40 | | -and following months needed to complete the first and last weeks represented as zeros""" |
| 40 | +"""Print all dates of January 2024 calendar as numerical days of the month |
| 41 | +including dates from previous and following months needed to complete the |
| 42 | +first and last weeks represented as zeros""" |
41 | 43 |
|
42 | 44 | for day in text_calendar.itermonthdays(2024, 1): |
43 | 45 | print(day) |
44 | 46 |
|
45 | | -"""Print all dates of January 2024 calendar as tuples containing the day of the month and day of the week |
46 | | -as numbers""" |
| 47 | +"""Print all dates of January 2024 calendar as tuples containing the day of |
| 48 | +the month and day of the week as numbers""" |
| 49 | + |
47 | 50 | for day in text_calendar.itermonthdays2(2024, 1): |
48 | 51 | print(day) |
49 | 52 |
|
50 | 53 | """Check if a given year is a leap year""" |
| 54 | + |
51 | 55 | calendar.isleap(2024) |
52 | 56 |
|
53 | 57 | """Return the number of leap years between two given years""" |
| 58 | + |
54 | 59 | calendar.leapdays(1980, 2024) |
0 commit comments