Acceptable Password V

Acceptable Password V

In this mission you need to create a password verification function.

The verification conditions are:

  • the length should be bigger than 6;
  • should contain at least one digit, but it cannot consist of just digits;
  • having numbers or containing just numbers does not apply to the password longer than 9;
  • a string should not contain the word "password" in any case.

Input: A string (str).

Output: A logic value (bool).

Examples:

assert is_acceptable_password("short") == False
assert is_acceptable_password("short54") == True
assert is_acceptable_password("muchlonger") == True
assert is_acceptable_password("ashort") == False

How it’s used: For password verification form. Also it's good to learn how the task can be evaluated.

40