Write a program old_macdonald.py
that prints out a series of verses for the song "Old MacDonald."
Each verse of the song uses an animal
and a sound
. For example, if the "dog" makes a "bark" sound, the verse is:
Old MacDonald had a farm, ee-yi-ee-yi-oh
and on that farm he had a dog, ee-yi-ee-yi-oh
With a bark, bark here, and a bark, bark there
Here a bark, there a bark, everywhere a bark, bark
Old MacDonald had a farm, ee-yi-ee-yi-oh
For this program, write a verse()
function that takes an animal
and a sound
as parameters and prints out the appropriate verse.
The main()
function of the program should call the verse()
function with a series of animal, sound
pairs so that the entire lyrics of the song are displayed.