i might add that
with open( . . .
instead of
foo = open( . . .
also shows some maturity in py
Abdur-Rahmaan Janhangeer,
Mauritius
abdurrahmaanjanhangeer.wordpress.com
On 11 Jun 2017 12:33, "Peter Otten" <__pete...@web.de> wrote:
> Japhy Bartlett wrote:
>
> > I'm not sure that they cared
Japhy Bartlett wrote:
> I'm not sure that they cared about how you used file.readlines(), I think
> the memory comment was a hint about instantiating Counter()s
Then they would have been clueless ;)
Both Schtvveer's original script and his subsequent "Verschlimmbesserung" --
beautiful german
It's really awkward the way you're using Counter here... you're making new
instances in every lambda (which is not great for memory usage), and then
not actually using the Counter functionality:
return sum(1 for _ in filter(lambda x: Counter(word) == Counter(x.strip()),
fileContent))
(the
Schtvveer Schvrveve wrote:
> I need someone's help. I am not proficient in Python and I wish to
> understand something. I was in a job pre-screening process where I was
> asked to solve a simple problem.
>
> The problem was supposed to be solved in Python and it was supposed to
> take two
> On Jun 5, 2017, at 09:36, Schtvveer Schvrveve wrote:
>
>
> And I was rejected. I just wish to understand what I could have done for
> this to be better?
>
> I am a Python beginner, so I'm sure there are things I don't know, but I
> was a bit surprised at the abruptness of
I need someone's help. I am not proficient in Python and I wish to
understand something. I was in a job pre-screening process where I was
asked to solve a simple problem.
The problem was supposed to be solved in Python and it was supposed to take
two arguments: filename and word. The program