Advertisement
Guest User

Untitled

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