```
a, b = 12, 5
if a+b:
print('True')
else:
print('False')
```

Write output with explanation in comment

We're a place where coders share, stay up-to-date and grow their careers.

loading...

```
a, b = 12, 5
if a+b:
print('True')
else:
print('False')
```

Write output with explanation in comment

amlan -

Łukasz Reszke -

Automation Bro -

Paul Facklam -

## Discussion (7)

All these answers are saying

`True`

, and that's right, but many of them suggest if an integer is greater than zero it's True, and that's not quite right - in effect, a coercion of an integer to boolean is performing`x != 0`

, so negative numbers also end up as True:'True' because 12+5=17 (int) and bool(int>0) = True

Result will be 'True' because by default, all Python Boolean values greater than 0 result to True.

Via the decoupling a becames 12 and b becames 5 thus their joined sum becames 17. Since 17 is a truthy value it passed the if check and thus prints True

True

True

True as int value is 17 which is greater than 0, and in python all boolean values greater than 0 given true output.