Restructured the entire folder and added this lesson's examples

This commit is contained in:
Manolo Hernandez Lütten
2026-06-05 14:44:13 +02:00
parent 07ca5d6258
commit d4851a961a
7 changed files with 65 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
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