在JSON字典中搜索关键字

我是python的新手,目前正在尝试允许用户在他们先前创建的笑话(设置和重点)中搜索关键字。如果用户在当前创建的笑话中搜索单词,那么我的目标是同时显示从中找到搜索到的单词的笑话的设置/提示。如果在任何笑话中都找不到搜索到的单词,我还打算打印一条错误消息,指出“没有笑话与搜索字词匹配”。

这是我的代码:

import json

def input_int(prompt):
    while True:
        value = input(prompt)
        try:
            numResponse = int(value)
        except ValueError:
            print("Invalid input - enter a number.")
            continue
        return numResponse

def input_something(enter_message):
    while True:
        inputSomething = input(enter_message)
        if len(inputSomething) < 1:
            print("Invalid Input - Enter Something.")
        if len(inputSomething) >= 1:
            return inputSomething

def save_data(data_list):
    with open('data.txt', 'w') as outfile:
            json.dump(data_list, outfile)

data_list = []
try:
    with open('data.txt') as openfile:  
        data_list = json.load(openfile)
except:
    TypeError

print('Welcome to the Joke Catalogue Admin Program.')

loop = True

while True:
    print('\nChoose [a]dd, [l]ist, [s]earch, [v]iew, [d]elete or [q]uit.')
    choice = input('> ')

    if choice == 'a':

            New_Setup = (str(input_something('Enter setup of joke: ')))
            New_Punchline = (str(input_something('Enter punchline of joke: ')))

            New_Joke = {"Setup" : New_Setup,
                        "Punchline" : New_Punchline,
                        "Laughs" : 0,
                        "Groans" : 0
                        }
            data_list.append(New_Joke)
            save_data(data_list)
            print("Joke added!")


    elif choice == 'l':

        print("List of jokes:")

        for index, New_Joke in enumerate(data_list):
            print(index, ')', New_Joke["Setup"])

    elif choice == 's':

        Search_Term = input_something('Enter search term: ')


    elif choice == 'v':

        if len(data_list) == 0:
            print('There are no jokes saved.')
        else:
            index = input_int("Joke number to view: ")

            if index < 0 or index >= len(data_list):
                print("Invalid index number.")
            else:
                New_Joke = data_list[index]

                print("Setup: " + New_Joke["Setup"])
                print("Punchline: " + New_Joke["Punchline"])



    elif choice == 'd':

        if len(data_list) == 0:
            print('There are no jokes saved.')
        delete_joke = input_int("Joke number to delete: ")

        try:
            data_list.pop(delete_joke)
            save_data(data_list)
        except IndexError:
            print('Joke does not exist.')            

    elif choice == 'q':
        print('Quitting joke bot! See you next time!')
        loop = False
        break

    else:
        print("Invalid choice - Please only select from the options provided!")

如您所见,[s]搜索选项为空,这是因为我被困在这里。任何帮助将不胜感激,因为我已经坚持了一段时间!