Hi have a dictionary word list in bio pythons trie implementation
i have a trie object named t with a huge dictionary loaded into it.
i have a dict map from integers to a alphabet for some odd encryption algorithm
what is the most elegant or pythonic way so when i search the trie, with a N letter word , to omit and delete all results with length less then or greater then N and only store the results with exact N length
say the inputs are 227 and 8733 which are mapped to letters in the dictionary like ([bar,car,carpet][tree,tree’s,treed,used]) i only want to keep the outputs as the same length, so when the input is 227 only car and bar will be outputted
the results i want should be ([bar,car],[tree,used])
So i want to OMIT all results that would be produced from the trie that have a larger or shorter length then the original input length
Or using genexpr: