Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. # Determine animal
  2.  
  3. kinds = ["a Herbivore", "a Carnivore", "a Omnivore", "starving"]
  4.  
  5. animal = raw_input("What animal? ")
  6. eatsMeat = raw_input("Does it eat meat? ").lower()
  7. eatsVegetables = raw_input("Does it eat vegetables? ").lower()
  8.  
  9. if(eatsMeat.find("yes") != -1 and eatsVegetables.find("yes") != -1):
  10.     kindOfAnimal = kinds[2]
  11. elif(eatsMeat.find("yes") != -1):
  12.     kindOfAnimal = kinds[1]
  13. elif(eatsVegetables.find("yes") != -1):
  14.     kindOfAnimal = kinds[0]
  15. else:
  16.     kindOfAnimal = kinds[3]
  17.    
  18. print "The " + animal + " is " + kindOfAnimal + '.'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement