I couldn't find if the following pine script statement can be written in a similar way using Python.
numWhy = (dirTrade == 0) ? 102 : goodDirection ? -103 : 104
or that it should be replaced by much more statements like
if dirTrade == 0:
numWhy = 102
elif goodDirection:
numWhy = -103
else:
numWhy = 104
I know that the longer version usually will be more readable (and thus preferable) but the short version becomes better readable if a lot of similar tests must be performed.
How can the short version be transformed from pine to Python maintaining a short notation?