-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat.py
32 lines (24 loc) · 838 Bytes
/
chat.py
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
30
31
32
import time
import random
name = input("Hello, what is your name? ")
# To give the user the impression its a real person add a delay before questions
time.sleep(random.randrange(5))
print("Hello " + name)
# Asking the user questions
feeling = input("How are you today? ")
time.sleep(5)
# Creating a response based on the users inputs
if "good" in feeling:
print("I'm feeling good too!")
elif "awesome" in feeling:
print("I'm feeling awesome too!")
elif "okay" in feeling:
print("I know how to make your day better")
else:
print("Chin up sunshine")
time.sleep(random.randrange(5))
favdog = input("What is your favorite dog breed? ")
# Radnomly generating a dog breed so the user feels a personal touch
dog = ["Lapsoopso", "Spaniel", "Sausage Dog"]
time.sleep(2)
print("My favourite dog is a " + random.choice(dog))