-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup2.py
More file actions
57 lines (45 loc) · 1.12 KB
/
signup2.py
File metadata and controls
57 lines (45 loc) · 1.12 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
#functions for login and sign up
global list1
global list2
ch=0
list1,list2=[],[]
def signup():
print("SIGN UP")
a = input("Enter username - ")
b = input("Enter password - ")
c = input("Re-enter password - ")
if(len(a)<4):
print("Username length too small!")
else:
list1.append(a)
if(b==c):
list2.append(b)
else:
print("Passwords do not match! Sign up again.")
list1.clear()
list2.clear()
print(list1)
print(list2)
def login():
print("LOGIN")
a = input("Enter username - ")
b = input("Enter password - ")
if(a in list1):
if(b in list2 and list1.index(a)==list2.index(b)):
print("Login Successful!")
else:
print("Invalid Credentials! Login again!")
while(ch<=4):
print("1. SIGNUP")
print("2. LOGIN")
print("3. EXIT")
ch=int(input("Enter choice - "))
if(ch==1):
signup()
elif(ch==2):
login()
elif(ch==3):
input("Press enter to exit")
break
else:
print("Invalid choice")