In this task, you're going to use your programming skills to print the words and count the presents in the Christmas song The Twelve Days of Christmas. If you missed the first assignment, click here for instructions on how to install Python. If you are unable to install Python then you can use Repl.it to run your programs on-line.
This assignment was inspired by my daughter's year 2 Christmas homework, which was to count the presents given in the song. If you can't remember how the song goes, or would like to read more about it, have a look at the Twelve Days of Christmas Wikipedia page. You could also look at the web-page we made to illustrate her answer.
Now you're getting better at programming, I'm going to give you less help. I will tell you, though, that I would use at least one list or tuple to store the names of the gifts - although you might use more if you want to do the extension task.
This is quite a bit more tricky that Ten Green Bottles. Think carefully about how the song is structured. There are twelve days, and on each day you need to mention all of the gifts you've received so far, so on the first day you mention one present, then on the second day you get the next present and are reminded of the first one, and so on. So your program needs to count up to twelve, but what else does it need to do?
Your task is to produce a program to print the words to the song The Twelve Days of Christmas. Your program should:
be efficient and use a loop - it shouldn't just print() the whole song
correctly list all of the presents (in the correct order) so far
consider how to lay out the words to make the song clear and easy to read
My daughter's Christmas homework was to work out how many presents were given altogether. Could your program work that out? What are the issues to consider.
You can use any other programming tricks you've learnt to improve the program. You could try, for example, to display the numbers of presents and the number of the day in words, rather than digits - e.g. "On the second day of Christmas my true love sent to me two turtle doves...".