Guest User

Untitled

a guest
Nov 7th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. # defining variables
  2. create_username = 0
  3. create_password = 0
  4. password = 0
  5. username = 0
  6.  
  7. # creates a users dictionary
  8. users = {
  9. 'Joe': 'juk725',
  10. 'Mat': 'axr3',
  11. 'Th3_j0k3r': 'bl4z3'
  12. }
  13. while username not in users and username != 'signup':
  14. username = input("enter username(type signup tocreate an account): ")
  15.  
  16. # add new user to dictionary
  17. if username == "signup" or username == "Signup":
  18. create_username = input("enter a new username: ")
  19. create_password = input("enter a new password: ")
  20.  
  21. if create_password in users:
  22. create_password = input("password taken re-enter: ")
  23. if create_username==create_password:
  24. create_password=input("password cannot be the same as your usename re-enter: ")
  25. # then adds the new username to the users dictionary
  26. if username == 'signup':
  27. users[create_username] = create_password
  28.  
  29. else:
  30. if username in users:
  31. password = input("enter password: ")
  32.  
  33. if password in users:
  34. print("access granted")
  35.  
  36. # just to see if it works
  37. print(users)
Add Comment
Please, Sign In to add comment