-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeAlpha_BasicChatBot.py
More file actions
29 lines (26 loc) · 967 Bytes
/
Copy pathCodeAlpha_BasicChatBot.py
File metadata and controls
29 lines (26 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
TASK 4: Basic Chatbot
Goal: Build a simple rule-based chatbot.
Scope:
● Input from user like: "hello", "how are you", "bye".
● Predefined replies like: "Hi!", "I'm fine, thanks!", "Goodbye!".
Key Concepts Used: if-elif, functions, loops, input/output
"""
print("\n\nThis is botbot,\nlet's have a basic conversation with the words :(hello, how are you, bye)\n")
print('if you would like to quit please enter the word (done)')
#loop tht always run unless user stops manually
# or the conversation ends as should b.
while True:
reply=input().lower().rstrip()
if reply == "hello":
print("Hi!\n")
elif reply == "how are you":
print("I'm fine, thanks!\n")
elif reply =="bye":
print("Goodbye!\n")
break
elif reply=='done':
print('program has been ended manually')
break
else:
print("sorry i can't understand, mayber try ome of the suggested words?")