Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # defining variables
- create_username = 0
- create_password = 0
- password = 0
- username = 0
- # creates a users dictionary
- users = {
- 'Joe': 'juk725',
- 'Mat': 'axr3',
- 'Th3_j0k3r': 'bl4z3'
- }
- while username not in users and username != 'signup':
- username = input("enter username(type signup tocreate an account): ")
- # add new user to dictionary
- if username == "signup" or username == "Signup":
- create_username = input("enter a new username: ")
- create_password = input("enter a new password: ")
- if create_password in users:
- create_password = input("password taken re-enter: ")
- if create_username==create_password:
- create_password=input("password cannot be the same as your usename re-enter: ")
- # then adds the new username to the users dictionary
- if username == 'signup':
- users[create_username] = create_password
- else:
- if username in users:
- password = input("enter password: ")
- if password in users:
- print("access granted")
- # just to see if it works
- print(users)
Add Comment
Please, Sign In to add comment