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-gyahun_dash 1 1
Yeah, at first I thought inheriting from Counter would be a nice idea. However, it's insistance on reducing negative counts to 0 is painful to fight against. Instead of that ugly polynomialize, you could have written something much more elegant: eval accepts a locals() dict as a second argument. So More
dict-Sim0000 1 1
Why dict instead of just a list? Also, those lambdas don't need to have the same arg specification, you can name them better than a[...]. More
77 chars-Sim0000 1 1
This can also be shorter. Just drop [] inside join(). More
First-Happiness 1 1
Seems ok. But you don't have to make tmp (as a name) and lstext (at all). Try this :-) import re p = re.compile(r"\W+").split def checkio(t, l=len, V = "AEIOUY", z=zip, S=sum, m=map): def s(w): if w.isalpha() and l(w) > 1: for c, d in z(w, w[1:]): More
First-tivvit 1
Nice. Of course, can be expressed with any. any(word.endswith(suffix) for suffix in words_set for word in words_set - {suffix}) Or itertools.permutations, if you're in the mood. :-) More
First-StarkyLife 1 1
Line 4 doesn't serve any purpose, you know? :-) In fact, you can just return the expressions from lines 6 and 8 directly. But it's nice to name at least the return value, when the function name is totally uninformative. ;-) "!= 0" can be removed from line 5. Read it as "if there is a remainder". I More
Second-Sim0000 1 1
Lot can be factored out from this. See my solution. ;-) More
First-tivvit 1
I think set(blah) & set(nyeh) is still nicer than set(blah).intersection(nyeh). But not much. More
First-coells 1
Don't write empty except. It almost never means what you think it means. For example, imagine someone confuses order of arguments, and calls index_power(3, [1,2,3,4]). You'd want TypeError, right? But you get -1. :-( More
root of unity-coells 1 1
Now you're just showing off. But I like it. :-D More
Sum of pigeons-LukeSolo 1
Since you have two lines anyway, how about extracting definition of l to separate line? :-) Also, you shouldn't use mutable defaults unless you _really_ know what you're doing. ps=() is much better. (Usually, = in default definitions doesn't have spaces around it. At least PEP8 says so.:) More
First-Wei5 1 1
I don't get it, why don't you just import hashlib directly?? More
kabopan-ciel 1 1
What's wrong with you people? :-) More
Cloud number n in ... e ...-veky 1 1
Thanks @StefanPochmann (do you ever sleep)? More
First of The square chest-grigoriytretyakov 1 1
inside is just `max(divmod(top-1, 4)) < 4 - length`. And set([spam for egggs]) is `{spam for eggs}`. And if you return a set(sides) from square, you can just use subset operator (`square <= lines`) in the last line. More
First-nsmirnoff 1
:-) Even if you _did_ want to convert words to a list (though there is no reason for that here), there is a nicer and explicit way: for y in list(words): More
Naive-Sim0000 1
This is not as naive as it seems. :-) More
hard way-theholy7 1 1
Pytonic way of writing switch is not enormous ifchain, but a dict. Great advantage is that names and codes are next to each other, so you can see what's what. def boolean(x, y, operation): code = dict( conjunction = x and y, disjunction = x or y, impl More
Raising head and cutting tail-LukeSolo 1
If you really want a faster algorithm, use collections.deque instead of list. Line 8 is O(n), and deque.popleft is O(1). More
oneliner-tivvit 1
Instead of lambda with \*, you can use `operator.mul`. Or if you don't want to import one module more, you can use `int.__mul__`. int(z) is duplicated, since this is the reverse of usual listcomp paradigm: you need map first, then filter over that. So you can use the building blocks directly. More