-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.py
More file actions
33 lines (31 loc) · 885 Bytes
/
Copy pathdatabase.py
File metadata and controls
33 lines (31 loc) · 885 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
30
31
32
33
cars = {'mercedez':'sedan','volvo':'saloon'}
def intro():
print('welcome to the database')
print("to get access enter your password")
enter_password()
def enter_password():
password = '123456'
entry1 = input('Enter password:')
if (len(entry1)< 3 and (entry1 != password)):
print('Access denied!')
else:
print("Access Granted")
data_base()
def data_base():
x = int(input("clear(1), update(2), print(3) : "))
if x == 1:
cars.clear()
print(cars)
print("Database cleared")
elif x==2:
update_dictionary()
elif x == 3:
print(cars)
def update_dictionary():
for i in range(3):
name =input("Enter name 0f the car: ")
desc = input("Enter the description: ")
cars[name] = desc
print(cars)
break
intro()