57
veky
22 48 64 Leader of the month
44584/ 53887
Last seen 19 hours ago
Member for 11 years, 6 months, 6 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
Decorator-veky 1
Don't let tidyness of this code fool you. ;-] More
First - lambdas-kryksyh 1
"square" is a very strange name for list of functions, don't you think? :-O More
Partial map-veky
Of course, another view at the [current top solution](http://www.checkio.org/mission/striped-words/publications/RRRQ/python-3/first/). More
First-asa119
Different operators can be chained, too: if res[0][0] == res[1][0] == res[2][0] != '.': Also, as you see, renaming your argument does wonders for readability. ;-] More
itemgetter-gyahun_dash
Finally someone who used groupby correctly. :-D You seem to have big problems with your iterators, since you're always trying to cram them into expressions. And map is not a panacea. :-) daily_secs = ((int(r[2]) for r in records) for records in daily_records) Or something like that. :-) But More
First-asa119 1
Basic idea is ok, but you have really too many cases, and (as a consequence of that) much duplication of code. An independent objection: indices are not really very semantic when describing your values. As I already said, naming is important. hundreds, tens, ones = map(int, str(number).zfill(3 More
7 Lines (per function)-carel.anthonissen 1
Doesn't this duplication bother you? :-) Also, `def min(*args, key=lambda x:x):`. And saving one line just to assign min_item to min_item is not a gain. Rather bite the bullet and write `if key(item) < key(min_item): min_item = item` in one line if you really don't want to use another line. More
Thirteen-Melissa_Guzman
What's the contest: how to write it using a maximal number of lines? :-D More
First-erolbayram
That's a very weird way of checking whether the array is empty. :-) Of course, the most Pythonic is simply "if not array:". More
Simple as hell-kamitenshi 1
Of course. Or just sum them directly. :-) More
First-sirmax
"sum" is a builtin. That should give you a hint. ;-) Also, don't iterate through indices if you can iterate through elements themselves. ;-] And, don't compare len with 0. More
First-Minifets
Either use `bin` sliced from 2, or use format as G-d intended. for pin in format(first, 'b'): Also, `int.bit_length` method might come handy. ;-) -- G-d means Guido, of course. :-) More
DP-gyahun_dash
If superior is local, getgain surely should have been local too. Then it wouldn't need enemy as parameter, same as superior doesn't need numsp and sumsp as parameters. repeat and chain.from_iterable, wonders from itertools. But might it be better to use collection.Counter, with its .most_common? ` More
First-udg23 1
Lines 4~7: Again, don't know about Py2, but you probably have .partition. Use that instead of .split, it fits much better. cmd, _, arg = i.partition(" ") For the other try (lines 8, 11 and 12): Yes, EAFP is nice, but sometimes it pays to be practical: if cmd == "POP" and stack: stack.pop( More
First-nemoyatpeace
Well, you said everything about ghastliness... so I won't go there. I'll just say that number of cases being finite is not an excuse to go haphazardly enumerating them. :-) But a more important lesson about how Python namespacing works: you `import` _names_, not objects. Conclusion: you don't need More
7 lines :)-carel.anthonissen 1
When using parallel iteration, try zip. Much simpler than range and a forest of brackets. :-) Also, `message +=` and `return ''.join(message)` directly. More
First-Alexandr_Zhytenko 1
Why do you extend the answer instead of just defining the answer? :-) answer = [0, 0, 0] else: answer = [ ... ] Also, in same style, you don't need line 3. Python doesn't have declarations of variables, it has names for its objects. More
I should make this better QQ-robby.daigle
Yeah, you should. :-D For start, study for-else loop. Much better than this insane flag manipulation. More
UGLY : When Coffee Is not an Option-robby.daigle
Lines 16~18: how about if s[-2]: ? :-) More
Seems to work-carel.anthonissen 2
Yup, something like that. But that quadrance calculation should really be factored out. At least see `math.hypot`. More