Find word by given characters

Bischoop Bischoop at vimart.net
Tue Nov 3 09:06:40 EST 2020


On 2020-11-03, dn <PythonList at DancesWithMice.info> wrote:
>
>
> The (full) specs are not clear. There's certainly room for 
> misunderstanding. I'd be happier if I could 'see' a full spec or 
> recognise a practical application, because then we'd be better able to 
> discuss facts. Meantime, we try to help with what we have been given...
>
>
> The OP's sample code only realises "conforming word[s]" (good term 
> BTW!). The snippet does not report any "count". Similarly, there's no 
> facts to avoid ("I assume") an assumption about whether "Letters" may 
> include duplication - indeed: whether duplication has meaning or should 
> be regarded as user-error.
>

Let me clarify what I want to do:
We all know Scrabble game.
there's a file with Dictionary containing word in each line, the idea is
to input some letters for example mentioned earlier: att, the script
supposed to find all words in which letters: 'a','t','t' occur and print
these words. It supposed not to print word: 'auto' because there's only
one 't' but words such as: 'toast', 'toasty', 'tolerant' are meeting the
criteria becase we have in these words one 'a' and two 't' as user has
input.
I've checked collections counter but seems to complicated for me at this
stage yet and I'm struggling with applying it.



More information about the Python-list mailing list