Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. correctpassword = "as1987Jantu35*^ft$TTTdyuHi28Mary"
  2. attempts = 0
  3.  
  4. while (attempts < 4):
  5.     password = input("Enter the password to access to the server: ")
  6.     if (password != correctpassword):
  7.         if (attempts == 0):
  8.             print("Incorrect, 1st hint: the password length is ",len(correctpassword), ".")
  9.         elif (attempts == 1):
  10.             print("Incorrect, 2nd hint: the password has ",sum(numbers.isdigit() for numbers in correctpassword)," numbers total.")
  11.         elif (attempts == 2):
  12.             print("Incorrect, 3rd hint: the password has ",correctpassword.count("i")," letter i's total.")
  13.         elif (attempts == 3):
  14.             print("You have tried too many times computer is now locked")
  15.         attempts += 1              
  16.     else:
  17.         print ("You have successfully logged in to the server as an admin")
  18.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement