diff --git a/altGoal.py b/altGoal.py new file mode 100644 index 0000000..88e627b --- /dev/null +++ b/altGoal.py @@ -0,0 +1,23 @@ +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 somethingElse: + print("Das verstehe ich nicht.") + + if text == "bye": + print("Tschüss!") + break +