Selecting a face in a script so that you can edit eg resize it?
It might seem counter-intuitive, but you need to be in Object mode to change the selection when using .mesh.  I changed a few more things, like you can use the 'DESELECT' action in mesh.select_all else edges are still selected when you try to un-select faces

import bpy

bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2, enter_editmode=True)
ob = bpy.context.object  # gets a reference to the newly created object 
ob.name = 'NewCylinder'
mesh = ob.data

bpy.ops.mesh.select_all(action='DESELECT')

bpy.ops.object.mode_set(mode = 'OBJECT')
n = 0
for face in mesh.polygons:
    if len(face.vertices) &gt; 4:
        n += 1
        if n == 2:
            face.select = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.transform.resize(value=(0.33, 0.33, 0.33))