y-or-n-p is a compiled Lisp function in `subr.el'.

(y-or-n-p PROMPT)

Ask user a "y or n" question. Return t if answer is "y".
PROMPT is the string to display to ask the question. It should
end in a space; `y-or-n-p' adds "(y or n) " to it.

No confirmation of the answer is requested; a single character is
enough. SPC also means yes, and DEL means no.

To be precise, this function translates user input into responses
by consulting the bindings in `query-replace-map'; see the
documentation of that variable for more information. In this
case, the useful bindings are `act', `skip', `recenter',
`scroll-up', `scroll-down', and `quit'.
An `act' response means yes, and a `skip' response means no.
A `quit' response means to invoke `keyboard-quit'.
If the user enters `recenter', `scroll-up', or `scroll-down'
responses, perform the requested window recentering or scrolling
and ask again.

Under a windowing system a dialog box will be used if `last-nonmenu-event'
is nil and `use-dialog-box' is non-nil.