x = 'foo' if bar else 'baz'
b.append(a) if a is not None else None
>>> [(i) for i in my_list if i=="two"]
['two']
[ x if x%2 else x*100 for x in range(1, 10) ]
visitorScore = res[3] if res[4] is not None else ""
var = [expression1] if [condition] else [expression2]
if condition:
value = true-expr
else:
value = false-expr
# The same can be written in single line:
value = true-expr if condition else false-expr
[what to do when condition=true] if [condition] else [what to do when condition=false]