Is it possible to do this on one line in Python?
if : myList.append(\'myString\')
I have tried the ternary operator:
You can do something like this:
myList.append('myString') if <condition> else False
or
myList.append('myString') if <condition> else 0