-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
60 lines (46 loc) · 1.07 KB
/
bot.py
File metadata and controls
60 lines (46 loc) · 1.07 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#bas
Contacts = {}
WW = True
Listen_comand = False
comand = ""
def add():
print("pleese input name andd number in format 'name number'")
new_number = input()
new_number.split(" ")
a = new_number[0]
b = new_number[1]
Contacts.update([a, b])
def change():
new_number = input()
new_number.split(" ")
a = new_number[0]
b = new_number[1]
Contacts[a] = b
def phone():
print("input name")
name = input()
result = Contacts[name]
def show_all():
print(f"{Contacts}")
def bye():
WW = False
print("Good bye!")
while WW == True:
comand = input()
if comand == "hello":
Listen_comand = True
print("How can I help you?")
comand = ""
#else:
#print("Whait for hello")
while Listen_comand == True:
if comand == "add":
add()
elif comand == "change":
change()
elif comand == "phone":
phone()
elif comand == "show all":
show_all()
elif comand == "good bye" or comand == "close" or comand == "exit":
bye()