def length_between(n1, n2):
    """Returns a function that checks whether a list's length is between ``n1``
    and ``n2`` (inclusive).

    Args:
        n1: The minimum length of the list.
        n2: The maximum length of the list.

    Returns:
        A function that takes in a list ``l`` and returns ``True`` if
        ``len(l)`` is between ``n1`` and ``n2`` (inclusive).
    """
    return lambda l: (len(l) >= n1 and len(l) <= n2)