-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthentication.py
More file actions
46 lines (37 loc) · 950 Bytes
/
authentication.py
File metadata and controls
46 lines (37 loc) · 950 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
34
35
36
37
38
39
40
41
42
43
44
45
46
def login():
global maidict
req=""
x=input("Enter the username to login : ")
print(maidict.keys())
if x in maidict.keys():
y=input("Enter the password to login : ")
req=maidict[x]
print(req)
if(req==y):
print("Login succesful !")
else:
print("wrong password !")
else:
print("Invalid username !")
def registration():
global maidict
n=input("Enter the username to be registered : ")
p=input("Enter the password to be registered : ")
maidict.update({n:p})
def invalid():
print("Invalid input")
def display():
print("Enter 1 for login \nEnter 2 for registration")
n=int(input())
return n
maidict={}
print("Welcome to Main Menu")
des=display()
if(des==1):
login()
elif(des==2):
registration()
display()
login()
else:
invalid()