Make 2 Objects Have Same Rotation So I have the following situation:

I have 2 objects: object A has no rotation(Since the rotation has been applied via ctrl-a) and object B has a random rotation. Now I want to make object A have the same rotation as Object B.  My guess is that  I somehow have to get the obj B rotation as a vector and then aim obj A in that direction. The thing is that I have to have the exact same rotation as obj B has. (If the rot of obj B is greater than 360, then obj A rot doesn’t have to be greater than 360, it should just aim in the same direction and the roll/yaw/pitch should be exactly the same. 
So how can I achieve this via Python?
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.