Python Check If Variable Is Nonetype