# Time 9, Exercise 1: local mean time for towns, and the railway time gap # The Earth turns 15 degrees an hour, so 1 degree of longitude = 4 minutes = 240 seconds of time. towns = { "Bristol": 2.59, # degrees west of Greenwich "Oxford": 1.26, "Edinburgh": 3.19, "Exeter": 3.53, "Norwich": -1.30, # negative = east of Greenwich } for name, west in towns.items(): behind_s = west * 240 # seconds behind London (negative = ahead) minutes = int(abs(behind_s) // 60) seconds = round(abs(behind_s) - minutes * 60) word = "behind" if behind_s > 0 else "ahead of" print(name, "sun time is", minutes, "min", seconds, "s", word, "Greenwich") # The gap between the two ends of the Great Western line (Bristol and London) gap_min = 2.59 * 4 print("Bristol clock vs London clock:", round(gap_min, 1), "minutes") # A timetable says "depart London 10:00, arrive Bristol 12:00". If Bristol still used its own # sun time, what would the Bristol town clock show when the train arrives at London-time 12:00? arrive_london_minutes = 12 * 60 bristol_clock = arrive_london_minutes - gap_min print("Bristol town clock at 12:00 London time:", int(bristol_clock // 60), "h", round(bristol_clock % 60, 1), "min") # Output when run: # Bristol sun time is 10 min 22 s behind Greenwich # Oxford sun time is 5 min 2 s behind Greenwich # Edinburgh sun time is 12 min 46 s behind Greenwich # Exeter sun time is 14 min 7 s behind Greenwich # Norwich sun time is 5 min 12 s ahead of Greenwich # Bristol clock vs London clock: 10.4 minutes # Bristol town clock at 12:00 London time: 11 h 49.6 min # Reading the output: 2.59 x 4 = 10.36 minutes, so Bristol's noon came about ten minutes after # London's. The Bristol town clock would read 11:49.6 when London's reads 12:00. That is why # the Bristol Corn Exchange clock famously carried two minute hands, one for each time.