Created
January 15, 2015 01:20
-
-
Save Echocage/2bfd26ad5beeecd26c89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
verses = ["a Partridge in a Pear Tree", "Two Turtle Doves", "Three French Hens", "Four Calling Birds", | |
"Five Gold Rings", "Six Geese-a-Laying", "Seven Swans-a-Swimming", "Eight Maids-a-Milking", | |
"Nine Ladies Dancing", "Ten Lords-a-Leaping", "Eleven Pipers Piping", "Twelve Drummers Drumming"] | |
days = {index - 1: ', '.join(reversed(verses[:index - 1])) for index, verse in enumerate(verses)} | |
def get_day(day):return "On the {} day of Christmas my true love sent to me,".format(day) + days[day] | |
def get_presents(start, end=None):return sum(range(start)) if not end else sum(range(start, end + 1)) | |
print(get_presents(11, 12)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment