Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- users = {'adam' : 'Test123', 'alice' : 'Test321'}
- status = ""
- status = input("If you have an account, type YES, NO to create a new user, QUIT to exit: ")
- while status != 'QUIT':
- if status == "YES":
- u_name = input("Please provide your username: ")
- u_pwd = input("Please provide your password: ")
- if users.get(u_name) == u_pwd:
- print("Access granted!")
- break
- else:
- print("User doesn't exist or password error! You have 2 more attempts!")
- elif status == "NO":
- print("nYou're about to create a new user on my very first app. Thank you!")
- new_u_name = input("Please select a name for your account!")
- new_u_pwd = input("Please select a password for your account!")
- users[new_u_name] = new_u_pwd
- print("Thank you " + new_u_name + " for taking the risk.")
- elif status == "QUIT":
- print("Smart choice lol. Please come back in few months")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement