Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- password = input()
- have_lowercase_char = False
- have_uppercase_char = False
- have_digit_char = False
- have_special_char = False
- have_valid_length = False
- special_chars = "$#@"
- for char in password:
- if char in string.ascii_lowercase:
- have_lowercase_char = True
- elif char in string.ascii_uppercase:
- have_uppercase_char = True
- elif char in string.digits:
- have_digit_char = True
- elif char in special_chars:
- have_special_char = True
- if 6 <= len(password) <= 16:
- have_valid_length = True
- if have_lowercase_char and have_uppercase_char and have_digit_char and have_special_char and have_valid_length:
- print("YES")
- else:
- print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement