python check if variable exists in dictionary