Код: Выделить всё
import csv
def getBreeds():
try:
with open("breeds.txt", "r") as f:
return f.read().split(",")
except:
return False
def findBreed(breeds, pet):
if pet not in breeds:
return "You don't have a known breed."
return "You have a known breed."
def main():
breeds = getBreeds()
if not breeds:
return "No list of breeds loaded."
return findBreed(breeds, input("What breed of cat do you have? "))
if __name__ == "__main__":
print(main())