Wie teile ich die Lösungen für meinen Code auf?

wenn Sie meinem Code ein Problem geben, sagt es Ihnen, dass Ihr Problem vorliegt, aber ich kann es nicht ändern, damit es mehrere Lösungen hat. Gibt es immer die gleiche Lösung für alle unterschiedlichen Probleme? Was ich frage, ist, wie man die richtige Lösung für das richtige Problem gibt und nicht alle Probleme, die nur zu einer Lösung führen, in der Print steht ("Die Lösung für Ihr Problem ist ...") gibt eine andere Lösung für die verschiedenen Probleme :) Vielen Dank im Voraus:))

 PROBLEMS = (('My phone does not turn on.',
             {'power', 'turn', 'on', 'off'}),
            ('My phone is freezing.',
             {'freeze', 'freezing'}),
            ('The screen is cracked.',
             {'cracked', 'crack', 'broke', 'broken', 'screen'}),
            ('I dropped my phone in water.',
             {'water', 'drop', 'dropped'}))


POSITIVE = tuple(map(str.casefold, ('yes', 'true','yeah', 'positive','thats right', 'yeah bro','yes', '1')))
NEGATIVE = tuple(map(str.casefold, ('no', 'false','na', 'not true','thats wrong', 'na bro','nope' '0')))


def main():
    """Find out what problem is being experienced and provide a solution."""
    description = input('Please describe the problem with your phone: ')
    words = {''.join(filter(str.isalpha, word))
             for word in description.lower().split()}
    for problem, keywords in PROBLEMS:
        if words & keywords:
            print('This may be what you are experiencing:')
            print(problem)
            if get_response('Does this match your problem? '):
                print('The solution to your problem is ...')
                break
    else:
        print('Sorry, but I cannot help you.')


def get_response(query):
    """Ask the user yes/no style questions and return the results."""
    while True:
        answer = input(query).casefold()
        if answer:
            if any(option.startswith(answer) for option in POSITIVE):
                return True
            if any(option.startswith(answer) for option in NEGATIVE):
                return False
        print('Please provide a positive or negative answer.')


if __name__ == '__main__':
    main()

Antworten auf die Frage(2)

Ihre Antwort auf die Frage