57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 21 hours ago
Member for 11 years, 6 months, 24 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-Gennady 1
set.intersection has an operator for that, & . Otherwise, fine solution. More
First-zoido 1 1
People write many languages in Python. But you're the first one I saw write XML in Python. :-O More
switch dict-kristof.jakab 1
The nice thing about Boolean operations is that they are total (defined everywhere on their relatively small domain) and very easy to compute. That together means you can just delete `lambda x,y:` and `(x, y)` parts, and it will still work, while being cleaner, shorter, and probably faster. You can More
First-Sim0000 1
Line 8 is the most important one. :-D More
Too eager ;-)-veky 1 1
Why is '00:45' not a problem for .lstrip('0')? ;-) More
FP & MetaOOP-flpo 1
Flat is better than nested, indeed. :-D The only thing you missed is that you could write line 25 as cube_volume = 3..__rpow__ :-D More
Simple-Taca 1
You were very close with that "key". ;-) return max(sorted(map), key=map.count) Also, you don't need re. You can just use "abcdefghijklmnopqrstuvwxyz" (also known as string.ascii_lowercase) as first argument to max, and key=text.count as second. But then it's too easy. :-D More
Obviously, right?-smilicic 1
Using << and >> instead of // and ** (oh yeah, and & instead of %) would be even more obviouslier. :-] More
Sum of chr-DiZ 1 1
Funny, this is exactly the same length: safe_pawns=lambda p:sum(bool({chr(ord(c)+o)+chr(ord(r)-1)for o in(-1,1)}&p)for c,r in p) More
Math Import-bdesign 1 1
Builtin pow is actually more **pow**erful than math.pow. :-) More
First-Sim0000 1
Of course there is a way to quote meta-characters. :-P More
Round-about way, but it worked. -andrewg12 1
Line 2 is unnecessary. You can have for x in text without problems. list is not the only iterable. Also, line 7 is horrible. 'jim' is probably some joke name, but much better would be to evade the naming altogether. You don't do anything beside just return it. return ''.join(uppercases) More
Third: using itertools.combinations-RomanKorbutyak 1
Why list? This is also one of frequent newbies mistakes, many objects can be iterated. You don't have to listify everything. list offers a special interface: appending at end, and random access by index. If you don't need these, you don't need list. --- And just for fun, you can look at [this](ht More
Shoooooooooort. :)-hrvoje 1
You could have written just `class checkio` instead of Override. :-) More
First-tivvit 1
First, really too many cases. Second, "if blah != 0" and "if blah > 0"... could really be just "if blah". Third, use divmod. It will be _much_ simpler than what you're doing (lines 20~21, lines 48~49,...). More
First-gyahun_dash 1 1
Slicing is better than indexing by range. And you don't need those mins then. More
Rough-LukeSolo 1 1
.71 is nice. Couldn't .8 work too? :-) Also, 0<=y< len(m[x]) wouldn't cost you a char, yet would be more explicit. ;-) And those int() calls would be more appropriate in []s at the end of first line. Lines length would be more balanced. ;-) More
Tribute to @veky-z00sts 1
If you're writing a tribute to me, at least drop brackets inside parentheses. sum(x for i, x in enumerate(array) if not i%2) But in fact, slicing is much simpler. You can use itertools.islice if you worry about memory. More
First-Sim0000 1 1
First, a defaultdict would _really_ help here. :-) Second, you don't need () inside [] indexing. Just d[i, j]. Third, end of line 11 can be just `... else max((n1, s1), (n2, s2))`. Tuples compare sensibly. :-) And fourth, you can get by without tracking lengths all the time, just calculate when n More
First, long and messy-Thenbacker 1 1
OMG. The dreaded "else: pass" pattern. :-D Also, why do you check for tuple at some point? (and for list at another!?) The code shouldn't depend on exact types passed into min/max. More