Skip to content

Instantly share code, notes, and snippets.

@simeondahl
Created June 14, 2014 14:52
Show Gist options
  • Select an option

  • Save simeondahl/bb8750903fdae960c03a to your computer and use it in GitHub Desktop.

Select an option

Save simeondahl/bb8750903fdae960c03a to your computer and use it in GitHub Desktop.
PythonLogin
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