4 ms·
You can also "return not not x" which turns the value into its boolean true/false equivalent ("!!x" in a C-like language). Or "return bool(x)" to make this mor
by coldtea 11y ago
You can also "return not not x" which turns the value into its boolean true/false equivalent ("!!x" in a C-like language).
Or "return bool(x)" to make this more explicit.
Those would be handy e.g. if the code that uses your result behaves differently 0 and False.