Question
In python 3 i need the following script updated script 1: import old_mcdonald def main(): old_mcdonald.title() old_mcdonald.verse('chicken', 'cluck') old_mcdonald.verse('cow', 'moo') old_mcdonald.verse('duck', 'quack') while old_mcdonald.query_verse(): option
In python 3 i need the following script updated
script 1:
import old_mcdonald
def main():
old_mcdonald.title()
old_mcdonald.verse('chicken', 'cluck') old_mcdonald.verse('cow', 'moo') old_mcdonald.verse('duck', 'quack')
while old_mcdonald.query_verse(): option = input('Do you want to have a fifth verse (yes/no)? ') #if the option is yes if option != 'no': name = input('Enter an animal: ') #check if the name is blank if name == '': print('The animal cannot be blank') #check if the name is already present elif name == 'cow' or name == 'chicken' or name == 'duck': print('The animal is already been used') else: #to enter sound sound = input('Enter the sound the it makes: ') print(' ') old_mcdonald.verse(name, sound) else: break
#when all the operations are over print('Thanks for singing with me.')
# run the program main()
script 2
def title(): print('Old McDonald') print(' ') pass
def verse(name, sound): print('Old McDonald had a farm, E-I-E-I-O.') print('And on that farm he had a ' + name + ', E-I-E-I-O.') print('With a ' + sound + '-' + sound + ' here, and a ' + sound + '-' + sound +' there.') print('Here a ' + sound + ', there a ' + sound + ', everywhere a ' + sound + '-' + sound + '.') print('With a cluck-cluck here, and a cluck-cluck there.') print('Here a cluck, there a cluck, everywhere a cluck-cluck.') print('Old McDonald had a farm, E-I-E-I-O. ') pass
def query_verse(): return True
I need the output to be cumalitive and to not allow blank input on yes/no. Right now when i get to the 5th verse, it does not call the other sounds that were already played, i need those in other verse in the 5th, 6th and so on. I also need help getting the good bye message to work.
I need the output to look like this
Old McDonald Old McDonald had a farm, E-I-E-I-O. And on that farm he had a chicken, E-I-E-I-O. With a cluck-cluck here, and a cluck-cluck there. Here a cluck, there a cluck, everywhere a cluck-cluck. Old McDonald had a farm, E-I-E-I-O. Old McDonald had a farm, E-I-E-I-O. And on that farm he had a cow, E-I-E-I-O. With a moo-moo here, and a moo-moo there. Here a moo, there a moo, everywhere a moo-moo. With a cluck-cluck here, and a cluck-cluck there. Here a cluck, there a cluck, everywhere a cluck-cluck. Old McDonald had a farm, E-I-E-I-O. Old McDonald had a farm, E-I-E-I-O. And on that farm he had a duck, E-I-E-I-O. With a quack-quack here, and a quack-quack there. Here a quack, there a quack, everywhere a quack-quack. With a moo-moo here, and a moo-moo there. Here a moo, there a moo, everywhere a moo-moo. With a cluck-cluck here, and a cluck-cluck there. Here a cluck, there a cluck, everywhere a cluck-cluck. Old McDonald had a farm, E-I-E-I-O. Enter an animal: cow The animal cow is already been used. Please try again. Enter an animal: turkey Enter the sound the animal makes: gobble Old McDonald had a farm, E-I-E-I-O. And on that farm he had a turkey, E-I-E-I-O. With a gobble-gobble here, and a gobble-gobble there. Here a gobble, there a gobble, everywhere a gobble-gobble. With a quack-quack here, and a quack-quack there. Here a quack, there a quack, everywhere a quack-quack. With a moo-moo here, and a moo-moo there. Here a moo, there a moo, everywhere a moo-moo. With a cluck-cluck here, and a cluck-cluck there. Here a cluck, there a cluck, everywhere a cluck-cluck. Old McDonald had a farm, E-I-E-I-O. Enter an animal: The animal cannot be blank. Please try again. Enter an animal: The animal cannot be blank. Please try again. Enter an animal: The animal cannot be blank. Please try again. Enter an animal: The animal cannot be blank. Please try again. Enter an animal: The animal cannot be blank. Thanks for singing with me.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started