This seems very verbose, particularly with long function names, is there a better way to do this in Python?
if someRandomFunction():
variable = someRandomFunction()
Edit: For more context variable is not already defined, and it will be a new node on a tree. I only want to create this node if someRandomFunction() returns a value. And someRandomFunction() is supposed to return the string representation of some node from a different type of tree.