Postgres And Python Operator Precedence Table In Python Using For Loop