# Time 5, Exercise 1: the planetary week and the "step of three" # Planets in the ancient order, slowest-moving first (longest orbit period to shortest) planets = ["Saturn", "Jupiter", "Mars", "Sun", "Venus", "Mercury", "Moon"] # Each hour of the day is ruled by the next planet in the list, wrapping round after the Moon. # A day is named after the planet that rules its FIRST hour. first = 0 # start on Saturn's day order = [] for day in range(7): order.append(planets[first % 7]) first += 24 # 24 hours later, the next day begins print("day names in order:", order) print("24 mod 7 =", 24 % 7, "so each new day starts", 24 % 7, "places further along the list") # Check against the real weekday order, Saturday first real = ["Saturn", "Sun", "Moon", "Mars", "Mercury", "Jupiter", "Venus"] print("matches Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday:", order == real) # The first six hours of Saturn's day print("Saturday hours 1-6:", [planets[h % 7] for h in range(6)]) # Output when run: # day names in order: ['Saturn', 'Sun', 'Moon', 'Mars', 'Mercury', 'Jupiter', 'Venus'] # 24 mod 7 = 3 so each new day starts 3 places further along the list # matches Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday: True # Saturday hours 1-6: ['Saturn', 'Jupiter', 'Mars', 'Sun', 'Venus', 'Mercury'] # Reading the output: jumping three places along a list of seven always visits every # planet before repeating (3 and 7 share no common factor), and it produces exactly the # order of the days: Saturn, Sun, Moon, Mars, Mercury, Jupiter, Venus. The week is the # planets' list read in steps of three.