Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def password_validator(password):
- if len(password) < 6 or len(password) >= 10:
- print("Password must be between 6 and 10 characters")
- if len([x for x in password if x.isdigit()]) < 2:
- print("Password must have at least 2 digits")
- if len([x for x in password if x.isalnum()]):
- print("Password must consist only of letters and digits")
- else:
- print("Password is valid")
- user_password = input()
- password_validator(user_password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement