I suppose your goal here is not for the script, as you say "or if there is a pre-build button".
So in edit mode, set the selection mode to 'face', select any quad and use the menu "Select/Select similar/Polygon Sides".
Once done you have all the quads, simply invert the selection with CtrlI to obtain non quad polygons.

The selection operators are dependent on the selection mode (vertex, edge, face), have a look at the menu for each case.
You may also want to select 'all by traits' to know if there is non manifold parts or loose geometry in your model.
If needed a commented script:
import bpy
# Go to object mode so that we can select
bpy.ops.object.mode_set(mode = 'OBJECT')
# Get active object
obj = bpy.context.active_object
# Select non quad faces (polygons)
for p in obj.data.polygons:
p.select = len(p.vertices) != 4
# Go in edit mode to show the result
bpy.ops.object.mode_set(mode = 'EDIT')