Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def password_validator(password_data):
- is_valid = True
- counter_digit = 0
- if not len(password_data) >= 6 and len(password_data) <= 10:
- print('Password must be between 6 and 10 characters')
- is_valid = False
- if not password_data.isalnum():
- print('Password must consist only of letters and digits')
- is_valid = False
- for digit in password_data:
- if digit.isdigit():
- counter_digit += 1
- if not counter_digit >= 2:
- print(f"Password must have at least 2 digits")
- is_valid = False
- if is_valid:
- print('Password is valid')
- current_password = input()
- password_validator(current_password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement