Day 2: Password Philosophy

Functions:

verify_line(line)

Verify an entry of the password database.

verify(min_count, max_count, character, password)

Verify the password under the given constraints.

verify_line(line: str) Optional[bool][source]

Verify an entry of the password database.

Requires
  • ENTRY_RE.match(line)

verify(min_count: int, max_count: int, character: str, password: str) bool[source]

Verify the password under the given constraints.

Requires
  • len(character) == 1

  • min_count <= max_count

  • max_count > 0

  • min_count > 0

Ensures
  • len(password) == 0not result