def print_terms(terms, parent):
 for term in terms:
  if (type(terms[term]) != dict):
   print(((' DCTB ' + parent) + term))
  else:
   print_terms(terms[term], ((parent + term) + '.'))

def print_terms ( terms , parent ) : for term in terms : if ( type ( terms [ term ] ) != dict ) : print ( ( ( ' DCTB ' + parent ) + term ) ) else : print_terms ( terms [ term ] , ( ( parent + term ) + '.' ) )
prints a list of flattened dictionary keys .