Untitled
unknown
python
4 years ago
707 B
11
Indexable
def check_password(user_password ):
suffix = ['%', '$', '#', '@', '!']
user_password = str(user_password)
x = len(user_password)
if (x == 5) & (user_password[x - 1] in suffix):
for i in range(x - 1 ):
if int(user_password[i]) > 9 | int(user_password[i]) < 0:
return "Wrong password"
return "Correct password"
else:
return "Wrong password"
def enter_password():
ask = "please enter password"
print(ask)
answer = str(input())
while (check_password(answer) == "Wrong password") :
print(ask+ ". Try again \n")
answer = str(input())
print("password saved ! Exiting... \n")
enter_password()
Editor is loading...