3 ms·
Apparently Rust doesn't. Julia/Perl have it, Python has it with words, and R code can import it.
by Mithaldu 9y ago
Apparently Rust doesn't. Julia/Perl have it, Python has it with words, and R code can import it.
- tripzilch 9y agoIn Python the if/else block does not return a value. Python has a ternary operator, which does return a value. It just so happens this operator uses the tokens `if` and `else`. But it's the same thing what you'd write in C or Javascript as `C ? T : F`, would be written `T if C else F` in Python. Different order of arguments and tokens, but it's still the ternary operator and not an if/else block. You can't get a result from block statements in Python. Just because the ternary operator uses the same tokens as the if/else block, doesn't mean it's the same thing.