a simple one liner!
"""using an object reference""" >>> bpy.context.scene.objects.active = bpy.data.objects["Cube"] # if checked to see which is now active >>> bpy.context.scene.objects.active # this may not update visibly as you might expect in the viewport, # but you will see the origin of active_object, and the name bottom left. bpy.data.objects['Cube']
active != selected, you could have 10 objects selected, of which only 1 can ever be active at a time. Or none selected, but 1 active. To get a better understanding of this not so intuitive situation: unselect everything, if you have two objects in the scene, the last one interacted with will be 'active' (as in, shows the origin, and name displayed bottom left)
Setting the state of an object to 'select = True' , is not the same thing
Setting the state of an object to 'select = True' , is not the same thing