May-06-2017, 01:39 AM
(May-06-2017, 01:28 AM)ichabod801 Wrote: You havecondition for s in list
, which generates a bunch of Trues and Falses. Changing that tos for s in list if condition
will generate the actual matching values.
Ok so I kinda get what you mean. Now I can print the list if it contains a matching keyword and in turn if it doesnt contain a matching keyword it will print ("unknown command") But instead of printing the matching titles to the keyword
e.g
Keyword = Dead
output
Dawn of the Dead, Land Of The Dead , Dead Calm etc etc
It just prints the whole txt file list of titles
selection = input("Please Select:") if selection =='s': list = movies_list keyword = str(input("Search keyword: ")) print (keyword) if any(keyword for s in list): for keyword in list: print(keyword) else: print("Unknown Command")