Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("user.txt") as f:
- A = [str(x) for x in f.read().split()]
- with open("password.txt") as j:
- B = [str(x) for x in j.read().split()]
- d={}
- lenA=len(A)
- for i in range(lenA):
- d[A[i]]=B[i]
- a='user selection'
- def enterpassword(i):
- username=input('enter username : ')
- password=input('enter password : ')
- if (username in d and d["username"]=="password"):
- print(a)
- else:
- while i<3:
- print("invalid login")
- enterpassword(i+1)
- while i>=3:
- newpw=password
- d[username]=newpw
- enterpassword(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement