Movements in blender


I heve two objects like plane and cube at different positions,
whenever i am clicking the plane or cube that will be moved to second object position.

for this how cani write the python script.

please help me in this.

Thanks & Regards,
Nithya . k

Select Cube, select Plane, Ctrl C / Copy Location