Skip to content

Instantly share code, notes, and snippets.

@ritobanrc
Created October 12, 2020 19:12
Show Gist options
  • Save ritobanrc/b03f451734c3329b5c2e000d41954c1d to your computer and use it in GitHub Desktop.
Save ritobanrc/b03f451734c3329b5c2e000d41954c1d to your computer and use it in GitHub Desktop.
A short script to print the lyrics to the 12 Days of Christmas
lyrics = ["Twelve drummers drumming", "eleven pipers piping",
"Ten lords a leaping", "nine ladies dancing", "eight maids a milking",
"Seven swans a swimming", "six geese a laying", "five gold rings",
"Four calling birds", "three French hens",
"Two turtle doves", "a partridge in a pear tree"]
lyrics.reverse()
ordinals = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eigth", "ninth", "tenth", "eleventh", "twelveth"]
for verse in range(len(lyrics)):
print("On the ", ordinals[verse], " day of Christmas, my true love gave to me, ")
for line, gift in enumerate(lyrics[:verse + 1].__reversed__()):
if line == verse and verse != 0:
print("and ", end='')
print(gift)
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment