To check the validity of password input by users.
Following are the criteria for checking the password:
- At least 1 letter between a-z.
- At least 1 number between 0-9
- At least 2 letter between A-Z
- At least 2 character from $#@,. ETC
- Minimum length of transaction password: 6
- Maximum length of transaction password: 12
Answers to this question couldn't clear the problems
I tried this but it doesn't worked
N = [1,2,3,4,5,6,7,8,9,0]
A = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
S = ['!','@','#','$','%','~','`','^','&','*','(',')','_','+','=','-']
pasw = input('Password: ')
if any((word in pasw for word in N,A,S)):
print ('OK')
else:
print ('TRY LATER')