Snippets tagged “one-line”
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.
1 snippet uses this tag.
In Python, you can put a simple if-then-else statement on one line using the ternary operator, which is represented by the "?" symbol.