import re


def valid_password(password):
    """Checks if password is valid"""
    # accepts passwords between 3 and 20 characters
    pass_re = re.compile(r"^.{3,20}$")
    return password and pass_re.match(password)