# Time 4, Exercise 3: converting Old Style dates and the short British year from datetime import date, timedelta def gap(year, month): if month < 3: year -= 1 return year // 100 - year // 400 - 2 def julian_to_gregorian(y, m, d): # Build the date with Python, shift by the gap (only used for dates that exist in both calendars) return date(y, m, d) + timedelta(days=gap(y, m)) # 1. George Washington: recorded as born 11 February 1731 "Old Style", when the British year # began on 25 March. Counting the year from 1 January, that Julian day is 11 February 1732. print("Washington:", julian_to_gregorian(1732, 2, 11)) # 2. The 'October' Revolution in Russia, 25 October 1917 in the Julian calendar print("Revolution:", julian_to_gregorian(1917, 10, 25)) # 3. Christmas on 25 December in the Julian calendar, as kept by some churches today print("Julian Christmas 2025:", julian_to_gregorian(2025, 12, 25)) # 4. The short British year of 1751 (25 March to 31 December) and the year 1752 short_1751 = (date(1751, 12, 31) - date(1751, 3, 25)).days + 1 print("British year 1751:", short_1751, "days") print("British year 1752:", 366 - 11, "days") # Output when run: # Washington: 1732-02-22 # Revolution: 1917-11-07 # Julian Christmas 2025: 2026-01-07 # British year 1751: 282 days # British year 1752: 355 days # Reading the output: Washington's birthday moves from 11 to 22 February (the year # label 1731 versus 1732 is the separate 25 March New Year effect, already handled # by writing 1732 in the code). The Russian "October" # Revolution happened on 7 November in the Gregorian calendar. Julian Christmas # falls on 7 January in the 2000s because the gap is 13 days. The British year # 1751 was only 282 days long, and 1752 was 355.