On 04/11/2020 19:12, Avi Gross wrote:
> My comments at end:
>
> -Original Message-
> From: Python-list On
> Behalf Of duncan smith
> Sent: Wednesday, November 4, 2020 1:09 PM
> To: python-list@python.org
> Subject: Re: Find word by given characters
>
>
My comments at end:
-Original Message-
From: Python-list On
Behalf Of duncan smith
Sent: Wednesday, November 4, 2020 1:09 PM
To: python-list@python.org
Subject: Re: Find word by given characters
On 04/11/2020 04:21, Avi Gross wrote:
> Duncan, my comments below yours at
On 04/11/2020 04:21, Avi Gross wrote:
> Duncan, my comments below yours at end.
>
> ---YOURS---
> The Counter approach only requires iterating over the letters once to
> construct the letters bag, then each word once to create the relevant word
> bag. After that it's (at worst) a couple of lookups
Duncan, my comments below yours at end.
---YOURS---
The Counter approach only requires iterating over the letters once to
construct the letters bag, then each word once to create the relevant word
bag. After that it's (at worst) a couple of lookups and a comparison for
each unique character in let
On 03/11/2020 22:14, Avi Gross wrote:
> I, too, have wondered what exactly the point was of the required
> functionality for SCRABBLE but note you can extend a current word so
> additional letters may be available in a game but only if they are an exact
> fit to put before, after, or in middle of y
On 03/11/2020 23:35, Bischoop wrote:
> On 2020-11-03, duncan smith wrote:
>>>
>>
> from collections import Counter
> letters = 'att'
> letter_counts = Counter(letters)
> word = 'tolerate'
> wd_counts = Counter(word)
> for char, cnt in letter_counts.items():
>> print (c
On 04/11/2020 12:27, Bischoop wrote:
On 2020-11-03, Chris Angelico wrote:
This seems strangely backwards for a Scrabble game. Normally you would
have a set of available tiles, and you have to form a word using only
those tiles, but it doesn't necessarily have to use them all. You seem
to have
On 2020-11-03, duncan smith wrote:
>>
>
from collections import Counter
letters = 'att'
letter_counts = Counter(letters)
word = 'tolerate'
wd_counts = Counter(word)
for char, cnt in letter_counts.items():
> print (cnt == wd_counts[char])
>
>
> True
> Tru
On 2020-11-03, Chris Angelico wrote:
>
> This seems strangely backwards for a Scrabble game. Normally you would
> have a set of available tiles, and you have to form a word using only
> those tiles, but it doesn't necessarily have to use them all. You seem
> to have something where you must use al
three also has
overhead.
-Original Message-
From: Python-list On
Behalf Of Chris Angelico
Sent: Tuesday, November 3, 2020 12:35 PM
To: Python
Subject: Re: Find word by given characters
On Wed, Nov 4, 2020 at 1:11 AM Bischoop wrote:
> Let me clarify what I want to do:
> We all kn
On Wed, Nov 4, 2020 at 1:11 AM Bischoop wrote:
> 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 le
On 03/11/2020 14:06, Bischoop wrote:
> On 2020-11-03, dn 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. Mea
Bischoop writes:
> 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
On 2020-11-03, dn 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
On 03/11/2020 13:13, duncan smith wrote:
On 02/11/2020 19:09, dn wrote:
On 02/11/2020 23:29, Bischoop wrote:
On 2020-11-01, duncan smith wrote:
But this generates the letters counts for each word. They only need to
be generated once (outside the for loop). And using count requires
iterating o
On 03/11/2020 12:10, Bischoop wrote:
On 2020-11-02, dn wrote:
If you have a working Py2 version, once print-statements were changed
into functions, what errors were thrown-up?
That was almost 15 if no more years ago when I was learning then had a
long break beacause Life :-) Got married, work
On 02/11/2020 19:09, dn wrote:
> On 02/11/2020 23:29, Bischoop wrote:
>> On 2020-11-01, duncan smith wrote:
>>>
>>> But this generates the letters counts for each word. They only need to
>>> be generated once (outside the for loop). And using count requires
>>> iterating over the letters / wo
On 2020-11-02, dn wrote:
>
>
> If you have a working Py2 version, once print-statements were changed
> into functions, what errors were thrown-up?
>
>
That was almost 15 if no more years ago when I was learning then had a
long break beacause Life :-) Got married, working as Chef, now have some
mo
On 02/11/2020 23:29, Bischoop wrote:
On 2020-11-01, duncan smith wrote:
But this generates the letters counts for each word. They only need to
be generated once (outside the for loop). And using count requires
iterating over the letters / words for each x in letters (rather than
once). For a
On 2020-11-01, duncan smith wrote:
>>
>
> But this generates the letters counts for each word. They only need to
> be generated once (outside the for loop). And using count requires
> iterating over the letters / words for each x in letters (rather than
> once). For a large enough collection of w
On 01/11/2020 13:38, Bischoop wrote:
> On 2020-11-01, Bischoop wrote:
>> I'm working on a script i which user inputs letters and then a printed
>> words containing those letters. The scripts works however I can't solve
>> one problem , it prints also words in which these letters occur more
>> tha
On 2020-11-01, Bischoop wrote:
> I'm working on a script i which user inputs letters and then a printed
> words containing those letters. The scripts works however I can't solve
> one problem , it prints also words in which these letters occur more
> than once.
> ---
> Fore exampl
On 10/31/2020 8:36 PM, Bischoop wrote:
I'm working on a script i which user inputs letters and then a printed
words containing those letters. The scripts works however I can't solve
one problem , it prints also words in which these letters occur more
than once.
---
Fore example:
L
On 2020-11-01 00:36, Bischoop wrote:
I'm working on a script i which user inputs letters and then a printed
words containing those letters. The scripts works however I can't solve
one problem , it prints also words in which these letters occur more
than once.
---
Fore example:
Let
I'm working on a script i which user inputs letters and then a printed
words containing those letters. The scripts works however I can't solve
one problem , it prints also words in which these letters occur more
than once.
---
Fore example:
Letters: at
Output: auto, autobahn.
-
25 matches
Mail list logo