Make 2 Objects Have Same Rotation
If you just want to copy the rotation values, there is "Copy Rotation" in the Constraints tab, no need for Python scripts. If you need it for a Python script, objects have rotation_euler, rotation_quaternion, and rotation_axis_angle attributes, and rotation_mode for selecting one of them.