myVariable = testVariable if bool(testVariable) else somethingElse
myVariable = testVariable if testVariable is not None else somethingElse
Is there a Python shortcut for variable checking and assignment?