How can I analyze whether my camera is looking up/down? The question is exactly the same as the title: How can I analyze whether my camera is looking up/down? :)

A bit of explanation: I am writing a script that handles both 3rd and 1st person view, and now got stuck at the point where I want setting a cap to prevent the view from turning around vertically.

For this I made an "if... elif... elif..." statement.
The first branch tests, whether the sight is between the caps, and if so, then lets the user move the view.
So after that, I need to check which direction the user wants to move the view, plus which direction is it stuck to. These do for the 2 other branches.

So this is why I'd need your help.

Awaiting your answers :)
When the camera's X rotation (in euler rotation) is at 90 degrees it is looking parallel to the ground. Less than 90 it will be pointing down at the ground, greater than 90 is pointing up.

if camera.rotation_euler.x &gt; 90 and camera.rotation_euler.x &lt; 180:
    # looking up
elif camera.rotation_euler.x &lt; 90 and camera.rotation_euler.x &gt; 0:
    # looking down