Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('Insert password')
- s = input()
- if len(s) < 8:
- print('Password length < 8')
- exit(1)
- count_letter = 0
- count_number = 0
- count_special = 0
- for i in range(len(s)):
- if s[i] >= '0' and s[i] <= '9':
- count_number += 1
- if (s[i] >= 'a' and s[i] <= 'z') or (s[i] >= 'A' and s[i] <= 'Z'):
- count_letter += 1
- if s[i] == '@' or s[i] == '%' or s[i] == '#':
- count_special += 1
- if count_number < 1 or count_special < 1 or count_letter < 1:
- print('Invalid password')
- exit(1)
- print('Good password!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement