Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- correctpassword = "as1987Jantu35*^ft$TTTdyuHi28Mary"
- for attempts in range(4):
- password = input("Enter the password to access to the server: ")
- if (password != correctpassword):
- if (attempts == 0):
- print("Incorrect, 1st hint: the password length is ",len(correctpassword), ".")
- elif (attempts == 1):
- print("Incorrect, 2nd hint: the password has ",sum(numbers.isdigit() for numbers in correctpassword)," numbers total.")
- elif (attempts == 2):
- print("Incorrect, 3rd hint: the password has ",correctpassword.count("i")," letter i's total.")
- elif (attempts == 3):
- print("You have tried too many times computer is now locked")
- else:
- print ("You have successfully logged in to the server as an admin")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement