[Tutor] Python - help with something most essential
David Rock
david at graniteweb.com
Mon Jun 5 21:48:05 EDT 2017
> On Jun 5, 2017, at 09:36, Schtvveer Schvrveve <sch4444 at gmail.com> 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 the rejection and I'm worried I'm
> doing something profoundly wrong.
The main thing that jumps out to me is the memory issue they asked you to address was not addressed.
In your readFile, you have
with open(filename) as f:
content = f.readlines()
Which reads the entire file into memory. They specifically did not want you to do that.
The implication is they were looking for a solution where you read the file maybe one line (or even one word) at a time and look for anagrams in smaller groups.
—
David
More information about the Tutor
mailing list