Python Detect If Variable X