Commit c8eb8152 authored by Adam Blank's avatar Adam Blank
Browse files

Add new file

parent 91a7f19b
No related merge requests found
Showing with 20 additions and 0 deletions
+20 -0
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!")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment