Advertisement
Guest User

Untitled

a guest
May 1st, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. with open("user.txt") as f:
  2. A = [str(x) for x in f.read().split()]
  3.  
  4. with open("password.txt") as j:
  5. B = [str(x) for x in j.read().split()]
  6.  
  7. d={}
  8. lenA=len(A)
  9. for i in range(lenA):
  10. d[A[i]]=B[i]
  11. a='user selection'
  12.  
  13. def enterpassword(i):
  14. username=input('enter username : ')
  15. password=input('enter password : ')
  16. if (username in d and d["username"]=="password"):
  17. print(a)
  18. else:
  19. while i<3:
  20. print("invalid login")
  21. enterpassword(i+1)
  22. while i>=3:
  23. newpw=password
  24. d[username]=newpw
  25.  
  26.  
  27. enterpassword(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement