Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. users = {'adam' : 'Test123', 'alice' : 'Test321'}
  2. status = ""
  3. status = input("If you have an account, type YES, NO to create a new user, QUIT to exit: ")
  4.  
  5. while status != 'QUIT':
  6.  
  7. if status == "YES":
  8. u_name = input("Please provide your username: ")
  9. u_pwd = input("Please provide your password: ")
  10.  
  11. if users.get(u_name) == u_pwd:
  12. print("Access granted!")
  13. break
  14.  
  15. else:
  16. print("User doesn't exist or password error! You have 2 more attempts!")
  17.  
  18. elif status == "NO":
  19. print("nYou're about to create a new user on my very first app. Thank you!")
  20. new_u_name = input("Please select a name for your account!")
  21. new_u_pwd = input("Please select a password for your account!")
  22. users[new_u_name] = new_u_pwd
  23. print("Thank you " + new_u_name + " for taking the risk.")
  24.  
  25. elif status == "QUIT":
  26. print("Smart choice lol. Please come back in few months")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement