If you don&#x27;t care about side effects:<p>C:<p><pre><code>    int foo = bar ? 2 : 4;
</code></pre>
Go:<p><pre><code>    foo := map[bool]int{true:2, false:4}[bar]
</code></pre>
Python had a similar trick before 2.5 added ternary conditionals.