For each one of the passwords provided, complete the missing variables (with a question mark ?) providing the correct operators.

### Test Cases

test is longh enough -

def test_is_longh_enough():
assert is_long_enough_pwd_1 is False
assert is_long_enough_pwd_2 is True
assert is_long_enough_pwd_3 is False
assert is_long_enough_pwd_2 is True


test at least one number -

def test_at_least_one_number():
assert has_one_number_pwd_1 is False
assert has_one_number_pwd_2 is True
assert has_one_number_pwd_3 is True
assert has_one_number_pwd_4 is True


test at least one symbol -

def test_at_least_one_symbol():
assert at_least_one_symbol_pwd_1 is False
assert at_least_one_symbol_pwd_2 is False
assert at_least_one_symbol_pwd_3 is True
assert at_least_one_symbol_pwd_4 is True


test has required character -

def test_has_required_character():
assert has_required_character_pwd_1 is False
assert has_required_character_pwd_2 is True
assert has_required_character_pwd_3 is True
assert has_required_character_pwd_4 is True


Solution 1

# #### Don't change these passwords #### #
password_3 = '81$br&j#' password_4 = 'kp03%$Ji19Br!rdV'
# #### Don't change these passwords #### #

# == Your Code Below == ##

## Is Long Enough
# Has at least 12 chars
is_long_enough_pwd_1 = len(password_1) >= 12  # False

## Has at least one of the following numbers: 0, 1, 2, 3
has_one_number_pwd_1 = (
has_one_number_pwd_2 = (
has_one_number_pwd_3 = (
has_one_number_pwd_4 = (

## Has at least one of these characters, v, V, r, R, b, B.
has_required_character_pwd_1 = (
has_required_character_pwd_2 = (
has_required_character_pwd_3 = (
has_required_character_pwd_4 = (
## Has at least one symbol: $%#& at_least_one_symbol_pwd_1 = ( '$' in password_1 or
'$' in password_2 or '%' in password_2 or '#' in password_2 or '&' in password_2) at_least_one_symbol_pwd_3 = ( '$' in password_3 or
'$' in password_4 or '%' in password_4 or '#' in password_4 or '&' in password_4)  # #### Don't change these passwords #### # password_1 = 'Jhx85a' password_2 = 'ajd2819adkBjld' password_3 = '81$br&j#' password_4 = 'kp03%$Ji19Br!rdV' # #### Don't change these passwords #### # # == Your Code Below == ## ## Is Long Enough # Has at least 12 chars is_long_enough_pwd_1 = len(password_1) >= 12 # False is_long_enough_pwd_2 = ? is_long_enough_pwd_3 = ? is_long_enough_pwd_4 = ? ## Has at least one of the following numbers: 0, 1, 2, 3 has_one_number_pwd_1 = ? has_one_number_pwd_2 = ? has_one_number_pwd_3 = ? has_one_number_pwd_4 = ? ## Has at least one of these characters, v, V, r, R, b, B. has_required_character_pwd_1 = ? has_required_character_pwd_2 = ? has_required_character_pwd_3 = ? has_required_character_pwd_4 = ? ## Has at least one symbol:$%#& at_least_one_symbol_pwd_1 = ? at_least_one_symbol_pwd_2 = ? at_least_one_symbol_pwd_3 = ? at_least_one_symbol_pwd_4 = ?