Python - How do i change the child of a child of an object?
Extending a list of Children
You can make a list of children and extend the list with the children of each child. After renaming a children, it is removed from the list.
import bpy

def execute(context):
    ob = context.object
    
    if ob == None:
        return
    
    children = list(ob.children)
    index = 0
    while len(children):
        child = children.pop()
        child.name = ob.name + str(index).zfill(3)
        children.extend(child.children)
        index += 1
        
execute(bpy.context)

Recursively walking the Children
You can also create a function, which renames the children of an object (parameter) and calls itself for each of the children.
import bpy

def renameChildren(ob):
    for child in ob.children:
        child.name = ob.name + &quot;_&quot; + child.type
        renameChildren(child)

def execute(context):
    ob = context.object
    
    if ob == None:
        return
    
    renameChildren(ob)
        
execute(bpy.context)