def has_rectangle(ptn, h, w):
    """ A partition ``ptn`` has an `h` x `w` rectangle if it's Ferrer's diagram has `h` (*or more*) rows of length `w` (*exactly*).

    EXAMPLES::

        sage: has_rectangle([3, 3, 3, 3], 2, 3)
        True
        sage: has_rectangle([3, 3], 2, 3)
        True
        sage: has_rectangle([4, 3], 2, 3)
        False
        sage: has_rectangle([3], 2, 3)
        False

    ..  SEEALSO::

        :meth:`has_k_rectangle`
    """
    assert h >= 1
    assert w >= 1
    num_rows_of_len_w = 0
    for part in ptn:
        if part == w:
            num_rows_of_len_w += 1
    return num_rows_of_len_w >= h
