Implemented ternary if in the python backend