def addElementToListDictionaryIfNotThere(element, key, listDictionary):
 if (key in listDictionary):
  elements = listDictionary[key]
  if (element not in elements):
   elements.append(element)
 else:
  listDictionary[key] = [element]

def addElementToListDictionaryIfNotThere ( element , key , listDictionary ) : if ( key in listDictionary ) : elements = listDictionary [ key ] if ( element not in elements ) : elements . append ( element ) else : listDictionary [ key ] = [ element ]
add the value to the lists .