Python Check If Variable Is Undefined A Linear