altGoal.py hinzugefügt

This commit is contained in:
2026-06-01 16:51:19 +00:00
parent 6c4f0cc23e
commit 8a1d0fc79c
+23
View File
@@ -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