I have a text file with chicken, recipe for chicken as line 1 and beef, beef recipe as line 2.
I can search for the beef or chicken recipe if the user only types beef or chicken. But I want to search for beef recipes if the user types in "I would like to search for beef recipes" or chicken....
I am trying to use .split but not quite there. Below is my code.
while True:
food = input ("What food? ")
file = open("meals.txt", "r")
line = file.readline()
data = line.split(",")
if data[0] == food:
print(data[1])
file.close()