{% if bCat2 == True %}
True
{% else %}
False
Returns
I would like to add that if your logic is a bit more complex you might want to read about scopes.
As mentioned in official documentation:
As of version 2.10 more complex use cases can be handled using namespace objects which allow propagating of changes across scopes:
{% set ns = namespace(found=false) %}
{% for item in items %}
{% if item.check_something() %}
{% set ns.found = true %}
{% endif %}
* {{ item.title }}
{% endfor %}
Found item having something: {{ ns.found }}