slecting more than one bone ?

I am trying to write a script that adds a ik constraint ,
sets the chain count and sets the target of all the bones in the amature.
The following script will do what I want to the mHipLeft bone if it is
sclected. How do I make the script work for more than one bone?

import bpy
import bpy .ops

bpy.ops.pose.constraint_add(type=“IK”)

bpy.context.object.pose.bones[“mHipLeft”].constraints[“IK”]. chain_count = 1
bpy.context.object.pose.bones[“mHipLeft”].constraints[“IK”].target = bpy.data.objects[‘Empty.015’]

bpy.context.object.pose.bones[“mKneeLeft”].constraints[“IK”]. chain_count = 1
bpy.context.object.pose.bones[“mKneeLeft”].constraints[“IK”].target = bpy.data.object