57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 3 hours ago
Member for 11 years, 6 months, 7 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.

Best reviews / Newest reviews
First-smilicic
Funny usage of bisect. :-) Again you with "if len(blah) == 0: continue"... just say "if blah:" (and indent lines 8~10). blahset |= {item}... I really find blahset.add(item) easier to read. And Python does, too. ;-) Of course, the best solution would be "yield" - that is, neighbours is natur More
Annoying-smilicic
Yeah, annoying. :-P Too many irregularities and convolutions. It's time to learn about str.maketrans. ;-) ''.join([...]) - drop the brackets. Your code will be nicer, more readable, and faster. for i, z in ... and then using z[0], z[1]: you can unpack directly. for i, (d, j) in ... Also, More
Λ-smilicic
Wasn't it easier to give additional parameter than have inc and dec as separate functions? :-) Also, don't join([...for...]). Drop the brackets. More
Complex rotation-smilicic
Cool. But you really could have used what you imported from math, instead of that while. ;-P More
First-vadim.latypov
res: don't do this. It's much slower with no reason. Use for-else. for x, y, r in previous: if round(math.hypot(i-x, j-y)) != r: break else: return [i, j] (Or even better, use all with generator.) More
First-vanzaj
Cool, but can be done [better](http://www.checkio.org/mission/i-love-python/publications/veky/python-3/magnum-opus/). ;-) (In my defence, I _didn't_ misunderstand the task.;) A minor detail: it was probably easier to use .title, and then convert just L to l with (e.g.) .replace. More
Explicit Selfies-terryyin 1
Namespaces are one honking great idea -- let's do more of those! More
Heuristic and backtracking-ale1ster 1
Lines 4 and 5 are really ugly. See dict.setdefault. More
First-binilnilquad
Those two if-elses are unnecessary. If you really wanted to handle the case of empty data (despite the precondition), you could have done it like this: if length % 2: ... #handle the odd case elif data: ... #handle the even case elif is useful, empty list can be sorted trivially, and pytho More
classic dp -sndnyang 1
Lines 13~16 (and maybe others;) can be replaced with just one. Builtin max is your friend. ;-) More
First-kenaniah
... and all(re.search(p.join("[]"), data) for p in ("0-9", "a-z", "A-Z")) Eliminate duplication. ;-) More
First-kenaniah
You can eliminate line 22 if you assign tail='' instead of None. str is a sequence, None is not really a good fit there. More
transposed-acman
Now do this one using enumerate. It's not so simple as it seems. ;-D More
First-jehutyy
"while greater than zero, subtract", is usually simpler expressed as divmod. ;-) More
First-silentAp
Again, inconsistent and really too long names. Your create_dictionaries could really use the help of enumerate builtin. ;-) extract_digits seems so complicated, I think map(int, str(number).zfill(3)) is much clearer about what's going on. You don't even need map(int... if you're willing to treat t More
First-silentAp
That's a really strange flow control. Wasn't it easier (e.g.) if char.isupper(): upper = True break More
Simple-silentAp
Why are lines after 16 in the loop?? Also, they can be combined with "or". Also, you don't need () after if. And range(0, 3) is simply range(3). More
Array join-geruz
Also, drop the [] inside "".join. Here it doesn't matter much, but it's better to get the right instinct. There is no need to iterate through list(text)... "for c in text" is completely fine. Not everything is a list (and why do you call it array??:). More
I want to ride my bicycle-LukeSolo 1
Quicksort is nice. But list() is unnecessary, again. :-) More
Pretty simple-LukeSolo 1
Why the alias? Pythonic way is calling the constructor same as the type. You don't say to_int("34"), right? ;-P More