57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 1 day 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-michael.kej
Condition in line 7 is really strange. What is it doing there?? Also, int(round(blah, 0)) is just round(blah). And if you really use Py3, those / are truedivs. Don't write -2.0, write just -2. (Or better yet, cancel -1 and use 2.:) More
First-michael.kej
Clear?? Hm... classifying commands according to len? And checking "if letters != []" instead of just "if letters"? No, sorry. Not clear. ;-P More
First-michael.kej
That's one horrible code duplication. But more importantly, it doesn't work, does it? verify_anagrams("a", "ab") More
First-michael.kej
Lines 1 and 2: LOL. :-) Sometimes it is easier to just bite the bullet and write what you really mean. parens = {"(":")", "[":"]", "{":"}"} You could have simplified line 12 by putting one lion in Cairo first (see my solution and respective comments for explanation;). More
First-michael.kej
Clear? O RLY? :-D That -1 is eyestabbing. :-] More
First-michael.kej
If you really wanted to be _clear_, you'd probably use .count('1') as before. ;-] n &= n - 1 is a nice trick, but not really "clear" IMO. More
First-michael.kej
Cool. You could have used *args, but this is ok too. More
First-michael.kej
Builtin sum might come handy. And array[len(array)-1] is just array[-1]. More
First-michael.kej
Aaaargh. Too complicated for my poor eyes. :-/ "== True", why? And Lines 10~11, why not just [i]? And why not use a real dict, with setdefault instead of that checking all the time? Or better yet, just use a collections.Counter. Or even better, use builtin max with custom key. ;-P Detail: at the e More
lots of ifs-UndeadMonkey
First, list is unnecessary. "for entry in expression" works fine. brackets can also be a str, then you can just brackets += entry in line 7. (Yes, it's slower, but not much, and later code becomes _much_ simpler.) Line 6: if entry in "([{". Lines 11~17 (and twice more): if brackets.endswith( More
First run -UndeadMonkey
Really? re.match with literal? How about just "PUSH" in entry? Lines 11, 12 and 13 are just if m. But really, use a .split and be done with it. Or even a slice if you feel dirty. ;-) int(entry[5:]) Also, lines 18 and 23 are just if stack. Lines 19~20: del is cool if you don't need that value. If More
verbose-UndeadMonkey
This is _incorrect_! asin gives values up to pi/2, but angle\_b can of course be obtuse. Write a function for how you calculated angle_c, and apply it three times. Also, math.degrees could come handy. ;-) More
First-Mycroft0121 1
Yes, you should have used a dict. (Rule of thumb: if it would be an ordinary switch (with breaks after every case) in C, it is not if/elsif/elsif/else in Python. It is (probably) a dict. If it is too complicated for a dict (code differs, not only data), then it is a class. But it's almost never a bu More
EAFP Test-LewisFogden
If you're really using EAFP, then you don't need ifs. You be bold. assert r >= 0 <= c ... except (IndexError, AssertionError): pass If you really use EANP (it's easier to ask nothing than permission:), as here, you might find contextlib.suppressed context manager useful. Line 9: t More
First-LewisFogden
Again, sum of bools is probably easier. More
First-LewisFogden
collections.Counter might be nice. And code duplication should be eliminated. Make a function, and call it on rows and columns separately. More
Using Min-LewisFogden
Decorate-min-undecorate is out of fashion. min (or better here, max) has a key argument for that purpose exactly. And again, for c in text.lower() is better than rebinding text. (And why sorted??) More
Lambda for great justice!-LewisFogden
Without lambda, it would be even greater justice. :-P Just remove all "lambda x, y:", and (x,y) at the end. More
First-LewisFogden
List is not really a good queue. collections.deque is much better. More
DivMod Solution-LewisFogden
Wouldn't code be _much_ simpler if you had FIRST_TWENTY = [""] + FIRST_TEN + SECOND_TEN TENS = [None, None] + OTHER_TENS ? :-) More