import random
from game_utils import ask_for_choice, prompt_yes_no
def play_animal_game():
choices = ['cow', 'dog', 'horse', 'cat', 'bird']
choice = random.choice(choices)
animal = ask_for_choice(
"Which animal am I thinking of between " + ", ".join(choices) + "? ", choices)
if animal == choice:
print("Yes! It was " + choice + "!")
else:
print("No! It was " + choice + "!")
again = True
while again:
play_animal_game()
again = prompt_yes_no('Would you like to play again (y/n)? ')
print("Goodbye!")
-
Adam Blank authoredc8eb8152