Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pets = ["squirrel","cat","dog","mouse","bird","unicorn"]
- food = ["nuts","fish","bones","cheese","seeds","marshmallows"]
- query = input("What animal do you want to feed? ").lower()
- found = False
- for count in range(len(pets)):
- if query==pets[count] and not found:
- print("Your "+query+" eats "+food[count]+"!")
- found = True
- if not found:
- print("Sorry, I have no information on feeding a "+query+"!")
- query = input("What animal do you want to feed? ").lower()
- found = False
- count = 0
- while (not found and count < len(pets)-1):
- if query==pets[count] and not found:
- print("Your "+query+" eats "+food[count]+"!")
- found = True
- count=count+1
- if not found:
- print("Sorry, I have no information on feeding a "+query+"!")
- query = input("What animal do you want to feed? ").lower()
- if query in pets:
- print("Your "+query+" eats "+food[pets.index(query)]+"!")
- else:
- print("Sorry, I have no information on feeding a "+query+"!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement