Python 2.5 comes with "conditional expressions"
As developer you often would like to write one liners to assign value to variable which is based on logical condition
old style
if condition:
x = true_value
else:
x = false_value
new style
x = true_value if condition else false_value
saves you time but takes time to remember new syntax !
This blog is actually a very special blog! It automatically aggregates all posts from all other blogs. This allows you to easily track everything that is posted on this system.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |