def startswith(list, prefix):
    """
    Determine whether list starts with the given prefix.

    INPUT:

    - ``list`` -- list
    - ``prefix`` -- list representing the prefix

    OUTPUT:

    ``True`` or ``False``.

    Similar to :meth:`str.startswith`.

    EXAMPLES::

        sage: from sage.combinat.finite_state_machine import startswith
        sage: startswith([1, 2, 3], [1, 2])
        True
        sage: startswith([1], [1, 2])
        False
        sage: startswith([1, 3, 2], [1, 2])
        False
    """

    return list[:len(prefix)] == prefix