in python I want to select faces in edit mode by the index of for loop
import bpy
import bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)

print(len(bm.faces))

bm.faces[0].select=True

for f in bm.faces:
    print("face")


With the Default Cube that prints

6
face
face
face
face
face
face


to the system console.