Select all Objects with "x" amount of Vertices
Select scene objects
Iterating over objects in the scene will keep the selection result is confined to only objects  type mesh in the scene.
An object can be active but not selected.
Prior to blender 2.8
import bpy

context = bpy.context

for o in context.scene.objects:
    o.select = (o.type == 'MESH' and len(o.data.vertices) &lt;= 4)

in &gt; 2.8
o.select_set(o.type == 'MESH' and len(o.data.vertices) &lt;= 4)