An English Christmas carol.
"The Twelve Days of Christmas" is an English Christmas carol that enumerates in the manner of a cumulative song a series of increasingly numerous gifts given on each of the twelve days of Christmas.
- The gift on the first day is a partridge in a pear tree.
- The gift on the second day is two turtle doves.
- The gift on the third day is three french hens.
- The gift on the fourth day is four calling birds.
- The gift on the fifth day is five gold rings.
Write a program that outputs the song, "The Twelve Days of Christmas".
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
Hint: use a list of the days, "first", "second" etc. Use a list of the gifts. Iterate over both lists.
On the first of Christmas
My true love gave to me
A partridge in a pear tree.
On the second of Christmas
My true love gave to me
Two turtle doves
And a partridge in a pear tree.
On the third of Christmas
My true love gave to me
Three french hens
Two turtle doves
And a partridge in a pear tree.
On the fourth of Christmas
My true love gave to me
Four calling birds
Three french hens
Two turtle doves
And a partridge in a pear tree.
On the fifth of Christmas
My true love gave to me
Five gold rings
Four calling birds
Three french hens
Two turtle doves
And a partridge in a pear tree.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
On the first of Christmas
My true love gave to me
A partridge in a pear tree.
On the second of Christmas
My true love gave to me
Two turtle doves
And a partridge in a pear tree.
On the third of Christmas
My true love gave to me
Three french hens
Two turtle doves
And a partridge in a pear tree.
On the fourth of Christmas
My true love gave to me
Four calling birds
Three french hens
Two turtle doves
And a partridge in a pear tree.
On the fifth of Christmas
My true love gave to me
Five gold rings
Four calling birds
Three french hens
Two turtle doves
And a partridge in a pear tree.
Check that you have: