Question: I am new to the world of Python. I have this `'if statement'` in my jinja2 template:

```
{{context.disabled==True and "Yes" or "No"}}

```

I am not sure what this syntax is called, but it works like an `if`.

php equivalent would be: `echo $disabled ? "Yes" : "No"`

This is always returning `No` or `False` even though `context.disabled` is `True`,

Why is it behaving like this? I cant see why it is doing this, am I doing it wrong?

Answer: 
Not sure about boolean expressions in jinja templates, but you can use [conditions](http://jinja.pocoo.org/docs/switching/#conditions):

```
{% if context.disabled %} "Yes" {% else %} "No" {% endif %}

```
It should be
{{ 'Yes' if context.disabled else 'No' }}