How to Check if a Layer is PRESENT or ABSENT in a Project via PyQGIS?
len(QgsMapLayerRegistry.instance().mapLayersByName('the_Map_Layer_in_question')) != 0
True
if layer exists, otherwise False
boolean = False
layers = QgsMapLayerRegistry.instance().mapLayers()
for name, layer in layers.iteritems():
if layer.name() == ('the_Map_Layer_in_question'):
boolean = True
# if the map layer exists boolean == True, if it doesn't boolean == False