Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- password = input()
- contains_uppercase = False
- contains_lowercase = False
- contains_digit = False
- contains_other = False
- for sym in password:
- contains_digit = sym.isdigit() or contains_digit
- contains_lowercase = (sym.lower() == sym) or contains_lowercase if sym.isalpha() else contains_lowercase
- contains_uppercase = (sym.upper() == sym) or contains_uppercase if sym.isalpha() else contains_uppercase
- if not (sym.isdigit() or sym.isalpha()):
- contains_other = True
- break
- if contains_uppercase and contains_digit and contains_lowercase and (not contains_other):
- print("Пароль валидный")
- else:
- print("Пароль невалидный")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement