Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. def login():
  2. logstart = input("Do you have an account? ").lower()
  3. if logstart == "yes":
  4. while True:
  5. username = input("Username: ")
  6. password = input("Password: ")
  7. if username in logins:
  8. if logins[username] == password:
  9. return username
  10.  
  11. else:
  12. print_slow("Your password is incorrect.")
  13. else:
  14. print_slow("You don't exist.")
  15. elif logstart == "no":
  16. while True:
  17. username = input("Username: ")
  18. password = input("Password: ")
  19. confirm = input("Confirm password: ")
  20. if username in logins:
  21. print_slow("Sorry this already exists.")
  22. elif password != confirm:
  23. print_slow("there is a miss match with your passwords.Try again")
  24. else:
  25. logins[username] = password
  26. log = open("logins.pkl", "wb")
  27. pickle.dump(logins, log)
  28. log.close()
  29. break
  30.  
  31. else:
  32. print_slow("That is not the correct input")
  33. print("")
  34. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement