Help I can only make the cat answer the first and third question. What is wrong with my code? Thank you for your help.
def YOmama(event):
# Make the pet say the correct answer to the questions.
pet.say("two")
pet.say("pug life")
pet.say("ultimate pug life")
pass
# Use 'sayTwoWords' for the pet's "hear" event.
pet.on("hear", YOmama)
# Now relax and watch the show.
hero.say("One plus one is...?")
hero.say("WHat is your life")
hero.say("You down")
For each hero questions, pet should answer once. Instead your pet answer three times when to hear something, as the result it say three answers before your hero ask three questions.
You can try 3 functions
1 per answer
Or go with 1 answer for all question
pet.on works after activation in parallel
throughout the whole code execution time