Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sample login application with a couple test members login info to test against
- memeber_login_info = {"email@email.com": "12345678", "willy@wonka.com": "19841971#", "comingto@america.com": "1988princeAKEEM$"}
- def login():
- # user inputs email and password, in this test if the login info doesn't match
- # one of the three test member's info the user will be told, "invalid email or password"
- # and allowed to re-enter, when they input the right login info they'll be told
- # "login successful"
- print("Enter login email: ")
- email = input()
- print("Enter password: ")
- login_password = input()
- for login, pass_info in memeber_login_info.items():
- if login == email and pass_info == login_password:
- print("Login successful")
- break
- else:
- count = 3
- while count > 0:
- print("Invalid email or password")
- print("Enter login email: ")
- email = input()
- print("Enter password: ")
- login_password = input()
- count = count -1
- if email in memeber_login_info.keys() and login_password in memeber_login_info.values():
- if memeber_login_info[email] == login_password:
- print("Login successful")
- break
- elif count == 0:
- print("Forgot password?")
- login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement