I'm working on a school assignment and having some trouble. For it, I need to use lists and loops to have a user be able to input animals and sounds into two lists. The loop is then supposed to output the lyrics in a group, using the animal and sound where appropriate one at a time, so something like:
And on this farm he had a dog...etc and going through the song, and the next going And on this far he had a cat...etc through all animals and sounds in the list
Right now it partially works. A user is able to input three animals and three sounds, and the print will then run however it will only output the last entry in the list. I want it to print the lyrics with all entries from the list. I also want the user to be able to cancel out with -1, but everything I've tried has not functioned. If anyone can help that would be great! I've included my code so far below:
for song in range (3):
animal = input("Please Input an Animal: ")
sound = input("Please Input a Sound: ")
lyrics = "Old Macdonald had a farm, E- I- E- I- O," "And on that farm he had a %s, E- I- E- I- O." "With a %s - %s here,And a %s - %s there," "Here a %s, there a %s, Everywhere a %s - %s" "Old Macdonald had a farm, E- I- E- I- O!" % (animal, sound, sound, sound, sound, sound, sound, sound, sound)
print(lyrics)