Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. from random import choice
  2.  
  3.  
  4. animals = ["bear", "cow", "cat", "lion", "squirrel", "rat"]
  5. secret = choice(animals)
  6.  
  7.  
  8. def explain(what, hints):
  9. if secret == what:
  10. print(hints)
  11.  
  12.  
  13. explain("bear", "I can live in America in the forests.")
  14. explain("cow", "I eat grass. People like to eat me.")
  15. explain("cat", "People let me stay in houses. People like to play with me.")
  16. explain("lion", "I leave in the savana. I can eat zebras.")
  17. explain("squirrel", "There are lots of animals like me that live in Central Park. I live in trees.")
  18. explain("rat", "People hate me. There are a lot of animals like me at New York. People say that I am dirty.")
  19.  
  20. def printguess():
  21. guess = input("What animal am I? ")
  22. guess.lower
  23. if secret in guess:
  24. print("That is right!")
  25. else:
  26. print("That is not right.")
  27. printguess()
  28.  
  29.  
  30. printguess()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement