Created
June 14, 2014 14:52
-
-
Save simeondahl/bb8750903fdae960c03a to your computer and use it in GitHub Desktop.
PythonLogin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| neededPassword = "8513" | |
| maxLogins = 3 | |
| userLoginAttempts = 0 | |
| def Login(password): | |
| global maxLogins | |
| global neededPassword | |
| global userLoginAttempts | |
| userInputPassword = raw_input("Enter Password: ") | |
| if (userLoginAttempts < maxLogins): | |
| if (password = neededPassword): | |
| print("You are now logged in!") | |
| else: | |
| print("Your password is not logged in!") | |
| userLoginAttempts = userLoginAttelmpts + 1 | |
| else: | |
| print("You are not allowed to login!") | |
| while (1=1): | |
| userInput = raw_input("Command: ") | |
| if (userInput == "login"): | |
| Login() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment