Snippets tagged “conditional-expression”
1 snippet uses this tag.
- Putting a simple if-then-else statement on one linePython
In Python, you can put a simple if-then-else statement on one line using the ternary operator, which is represented by the "?" symbol.