altGoal.py hinzugefügt
This commit is contained in:
+23
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user