Advertisement
Guest User

Untitled

a guest
Nov 5th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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("Enter your username: ")
  6. password = input("Enter your password: ")
  7.  
  8. if username in logins:
  9.  
  10. if logins[username] == password:
  11. return username
  12. else:
  13. print("Your password is incorrect.")
  14. else:
  15. print("That doesn't exist, try again.")
  16. elif logstart == "no":
  17. while True:
  18. username = input("Please create a username: ")
  19. password = input("Please create a password: ")
  20. confirm = input("Confirm password: ")
  21. if username in logins:
  22. print("Sorry this already exists.")
  23. break
  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("That is not the correct input")
  33. print("")
  34. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement