-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleContactBook.py
More file actions
35 lines (27 loc) · 1.06 KB
/
simpleContactBook.py
File metadata and controls
35 lines (27 loc) · 1.06 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
dict = {}
mode = ''
while True and mode!=3:
mode = input("Da biste dodali kontakt pritisnite 1. Da biste nasli kontakt napisite 2. Da biste prekinuli pritisnite 3.\n")
mode = int (mode)
match mode:
case 1:
# x = input("Molim Vas unesite ime:\n")
# y = input("Molim Vas unesite broj telefona:\n")
# try:
# y = int (y)
# if len(str(abs(y)))<10:
# raise Exception()
# #if num_digits = len(str(abs(num)))
# dict[x] = y
# except:
# print("Niste uneli odgovarajuci broj\n")
x = input("Molim Vas unesite ime:\n")
y = input("Molim Vas unesite broj telefona:\n")
dict[x] = y
print (dict[x])
case 2:
x = input("Unesite ime konkta:\n")
try:
print ("Broj telefona " + x + " je: " + dict[x])
except: print("Nemate ovaj kontakt sacuvan")
# case _: print("Niste uneli odgovarajucu opciju!!!")