[Solved]Create Program Keeps Telling User Joke Consecutive Jokes Cannot Joke Must Follow Question Q37161364
Create a program that keeps telling the user a joke. Consecutivejokes cannot be the same. The joke must follow a question andanswer format. For example: Computer: “What’s the differencebetween a snowman and a snow-woman?” User: “Idk what?” Computer:”Snow Balls” The program must ask the user if they would like tokeep going after each joke. And if the user says no the programshould say goodbye and terminate. Otherwise, the program shouldcontinue on its next joke. The program should be able to tell aminimum of 20 different jokes. The program should be able to acceptmore than 3 different responses to the initial joke question,example “Idk what?”, “you tell me”, “I don’t know what?”, etc.
COULD YOU FIXMY ERROR . I HAVE SOLVED THIS CODE I JUST NEED TOFIX SOMETHING.(PYTHON PROGRAMMING)
import random randomJokes = [” What did the traffic light say tothe car?”, “Why was the little strawberry crying?”, “What do youcall a nosy pepper?”, “Why are frogs are so happy?”, “How do youbefriend a squirrel?”, “Have you heard about the corduroy pillow?”,”Why did the jaguar eat the tightrope walker?”, “What did the bigbucket say to the smaller one?”, “What did the big bucket say tothe smaller one?”, “Why do chicken coups always have two doors?”,”What did one hat say to the other?”, “Why did the lifeguard kickthe elephants out of the pool?”, ” What do you call a pony with acough?”, “What do you do if someone thinks an onion is the onlyfood that can make them cry?”, “What do you call a man with no armsor legs wading in a pool?”, “What do cows most like to read?”,”Howdoes a duck buy lipstick?”, “What do you call a guy with a rubbertoe?”, “What did the cop say to his stomach?”, “What do you call asnowman on a hot day?”, “What do you do with a sick boat?”]answerList = [[“Don’t look! I’m about to change.”], [“His mom wasin a jam.”], [“Jalapeño business.”], [“They eat whatever bugsthem.”], [“Just act like a nut.”], [“No? Really? It’s makingheadlines!”], [“It was craving a well-balanced meal.”], [“Lookin’ alittle pail there.”], [“With four, they’d be chicken sedans.”],[“You stay here. I’ll go on ahead.”], [“They kept dropping theirtrunks.”], [“Throw a coconut at their face.”], [“Bob.”],[“Cattle-logs.”], [“She just puts it on her bill.”], [“Roberto.”],[“Stop! I’ve got you under a vest!”], [“Puddle.”], [“Take is to thedoc already.”]] index= 0 yesInput = [“yes”, “tell me another”, “y”,”another”, “keep em coming”, “go”, “ok”] noInput = [“no”, “stop”,”n”, “no more”, “go away”, “bye”] noAnswer = [“Help”, “help”, “youtell me”, “Idk what?”, “you tell me”, “I don’t know what?”, “IDK”,”idk”, “I don’t know”, “Tell me the answer”, “tell me the answer”,”I don’t know what?”, “I don’t know what”] go = True go = Truewhile go: rawInput = input(“Would you like to hear a Joke”)formatedInput = rawInput.lower().strip(‘tnr’) isInputInYesList=formatedInput in yesInput isInputInNoList= formatedInput in noInputif isInputInYesList or isInputInNoList: if isInputInNoList:print(“Good Bye!”) go = False if isInputInYesList: rawInput =input(randomJokes[index]) formatedInput = rawInput.lower().strip(‘tnr’) print(answerList[index]) index = index + 1 else_inCorrectInput= True while inCorrectInput: rawInput = input(“nIdon’t understand what you are telling me. Try again Goodluck!”)formatedInput = rawInput.lower().strip(‘ tnr’) isInputInYesList= formatedInput in yesInput isInputInNoList=formatedInput innoInput
Expert Answer
Answer to Create a program that keeps telling the user a joke. Consecutive jokes cannot be the same. The joke must follow a questi… . . .
OR

