11
Peter.White
1 10 28
548/ 645
Last seen 3 years ago
Member for 9 years, 1 month, 28 days
Difficulty Normal
Best reviews / Newest reviews
First-Blukano
This doesn't work with exceptions as stated in the mission text. ;) Also, you are using the same **for** expression three times! More
Second-nsmirnoff
Should have used sets as suggested in the mission info. More
First-AlexanderSafronov
I knew it must be possible to use an arbitrary number of arguments. I just couldn't figure it put. Thanks for showing me. ;) More
Oneliner-zlomovsky
Doesn't use sets, though, as is suggested in the mission text. More
First-evdel
Could have just used sorted(_iterable_, _key_) More
First - Friends-AQiccl135
Could have saved yourself all that sorting. That's what **sets** are for. ;) More
First-Federigo
Could have used a **set** for self.connections. No need for doing deduplication yourself. More
Product (row,col) , can be written in one line-sevaader
Nice. I have to keep product() in mind. This is the second time, I didn't see its usefulness. ;) But line 7 seems a bit, for lack of a better word, 'manual' to me. Those are also two lists, that don't need to exist IMHO. And line 8 is just too long. Why not break it into multiple lines. That would More
Pangram-diegueus9 1
Oh my! ;) This is supposed to be speedy? For starters, set() and list() are unnecessary. And I believe, you lose more time sorting and RE-matching, than you gain. And a simle 'abcdefghijklmnopqrstuvwxyz' in ''.join(sorted(text.lower())) would have been enough, no need for RE-matching at all. More
Interesting-Komly 1
Line 2 is crying for a generator expression, if you ask me. ;) Also, line 5 smells. :P Hard to follow, whats going on and waaaayyy too long. More
First-mikewr80
What is it with throwing REs at everything that a string? And two of them no less. ;) Now I am not a RE expert, but I assert one would have done it. Anyway it is so not necessary to strip the string to search in: from string import ascii_lowercase as letters there. :P And then simply count let More
First-mikewr80 1
Oh, I totally overlooked that you do **text.lower()** on line 9 and _then_, immediately _after_ that, you get rid of everything that's not a character. Come on. ;) There are no lowercase _non-characters_. So, if anything, do the filtering first and _then_ the lowercasing. Oh, and for that regex? Ye More
First-AyomideBamidele
Why [-1] on line 3? Gets overwritten without doing anything with it on line 8. **str.count()** is at least 0, and if you get that far in your loop, then you at least didn't get an empty string to begin with. And the precondition says: 0 < len(text) ≤ 10**5. ;) Also, why must **let** be a list? Oh, More
Slow and Heavily Described.-BirrellWalsh
Why populate the **frequencies** dictionary on lines 4 and 5? It only needs to hold items with characters and their respective count. If count is 0, then it doesn't deserve to occupy memory in a dict. ;) Line 9 takes care of the rest. Line 11, while the **key** function is a neat idea: sorted( More
Slow and Heavily Described.-BirrellWalsh
Oh, let me add: Line 16, an endless loop, really? Could have used: for pos in range(26): # or at least while pos < 26: More
First-Xopeck
Not very readable, sorry. Single character varibles aren't very nice. Anyway, in lines 3 and 5 why not iterate over a range there too? You count the x and y indices up from 0 to 3 both time. And there are built-in functions and constructs, so one does not have to type all that stuff. Line 8, the sa More
Second-gyahun_dash
Nice. But the last line I don't like all that much. There is a variable in there, the player. The two **ifs** are basically the same only different players. More
First-JonTousse
Sorry, I don't understand the language of your comments and variables. English would have been nice. And at least the first 6 lines of your **lsligne** could have been autogenerated, I am sure of that. ;) Maybe not in one step, but in two. I don't like seeing such a long list being hardcoded. Genera More
First-e.roboda
Finally I see someone with the same idea of zipping the list. ;) I just found out that reversed(zip(*game_result)) is a 90 degree left rotation of the matrix. That makes the check of the diagonals a breeze. Have a look: http://www.checkio.org/mission/x-o-referee/publications/Peter.White/python-27/ More
First-panaro32 1
I like the nested list comprehension. Also nice use of enumeration. Lines 4 and 5 are repetitious, though, but pragmatic I guess. More
1
2
3 4