-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
53 lines (50 loc) · 1.5 KB
/
main.py
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
def signup():
user=input("enter username here")
password=input("enter password here")
file=open("details.txt", "a")
file.write(f"{user},{password}\n")
file.close()
print("--------------------------")
print("account created succesfully")
print("--------------------------")
def login():
user=input("enter username here")
password=input("enter password here")
file=open("details.txt", "r")
records=file.readlines()
flag=0
for i in records:
u,p=i.split(",")
if user==u:
flag=1
if password+"\n"==p:
print("---------------")
print("login succesful")
print("---------------")
else:
print("------------------")
print("incorrect password")
print("------------------")
if flag==0:
print("-----------------")
print("invalid username")
print("-----------------")
while True:
print("**************************")
print("Tanish authentication app")
print("**************************")
print("1-signup")
print("2-login")
print("3-exit program")
print("----------------------")
option=input("enter option number here: ")
print("----------------------")
if option=="1":
signup()
elif option=="2":
login()
elif option=="3":
print("thank you")
break
else:
print("invalid input")