-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.py
More file actions
30 lines (25 loc) · 737 Bytes
/
users.py
File metadata and controls
30 lines (25 loc) · 737 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
users = {}
status = ""
def displayMenu():
status = input("Are you a registered user? y/n Press q to quit ")
if status == "y":
oldUser()
elif status == "n":
newUser()
def newUser():
createLogin = input("Create Username: ")
if createLogin in users:
print("\nLogin name already exists!\n")
else:
createPassw= input("Create Password: ")
users[createLogin] = createPassw
print("\n User created\n")
def oldUser():
login = input("Enter Username: ")
passw = input("Enter Password: ")
if login in users and users[login] == passw:
print("\nLogin succesful!\n")
else:
print("\nUser doesn't exist or wrong password!\n")
while status != "q":
displayMenu()