If you don't mind I can append to your list several items more You can revert, for example, string just using slice
print(s[::-1])```
You can check condition in one line
``` i = 3
print(i if i < 5 else 0)```
or another if trick
``` condition = ['Error', 'OK']
value = 1
print(condition[bool(value)])```
As long as pyhton does not have switch construction you can use somthing like this
``` choice = 'i'
print({'i': 1, 't': 4, 'j': 22}[choice])```
1
u/pymag09 Jun 23 '14
If you don't mind I can append to your list several items more
You can revert, for example, string just using slice