print("Hallo! Ich bin ein Chatbot.") name = input("Wie heißt du?: ") promptsAndAnswers = { "hallo" : "Hallo!", "wie gehts" : "Gut", "bye" : "Tschüss" } print("Hallo", name) while True: text = input("Nachricht eingeben: ") try: print(promptsAndAnswers[text]) except Exception as somethingElse: print("Das verstehe ich nicht.") if text == "bye": print("Tschüss!") break