57
veky
22 48 64 Leader of the month
44618/ 53887
Last seen 12 hours ago
Member for 11 years, 6 months, 12 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
Pointless?-veky 2 1
At first sight, this is usual high-order functional stuff. But there are a few puzzling details, in the form of code that should do nothing, but without it, the solution doesn't work. :-] * Why is that "if (push, pop, peek)" there? 3-tuple should always be true, right? * Why is that "and (yiel More
Twisted images in transition-smilicic 2 1
Wow! A surprisingly algebraic (for you) approach. :-D One of those `image`s is really a `preimage`, right? :-) Also, `relation` deserves a better name. Though I don't know what it is. :-/ `precedes`? `P[i] is a` is (PNI) a very risky thing to write. Those are one-letter strings, which are most pro More
First-Fedorovich 2 1
This is a nice example of how chaining can help you write better code. First, x == 1 and y == 1 can be written as x == y == 1. Then you see you have it also in equivalence. if x == y == 1 or x == y == 0: Then you see you can factor out x == y. if x == y in (0, 1): Then you realize that More
A*, Empirically Improved Heuristic-PositronicLlama 2
It's nice and all, but haven't you overengineered it a bit? :-) The board has 64 squares, not a million. :-) More
Mark Pilgrim's library-macfreek 2 2
Few nitpicks: * romanNumeralMap really should be a dict. Yes, I know it won't be sorted, but you can sort it by value without problems, and it would probably help readability. * input checking leaves a lot to be desired. What if n is "123a"? isinstance(n, int) (or using ABC) would be much better. More
regexp-tivvit 2 1
Instead of re.match with `.*`, use re.search. It's there for exactly that purpose. ;-) For the pattern, you can use `("[A-Za-z]+ "*3).strip()`, or `" ".join(["[A-Za-z]+"]*3)`. Of course, if you name that pattern `word`, it would be much easier to follow. More
First-ablikexe 2 1
You don't need those \\ continuations (you're inside parentheses). Also, line 10 is just "if r > res - 1e-5:". Even that 1e-5 is probably overkill... you know any particular case where float arithmetic let you down in this task? I didn't care about that, and my solution works fine. Line 3: wasn't More
yield-oduvan 2 1
> Output: The list of integers. Yeah, right. :-P BTW, I'm quite sure I tried a generator anyway (a long time ago), and it didn't work. Did you change something? More
String arithmetic-nickie 2 1
Not really puzzling if you know that str times negative is "", but still cool. :-) More
Just let yourself be boring!-borisuvarov 2 2
If you don't want to be boring, you can always look at the @StefanPochmann's solution. ;-) More
First-splinter12345 2
Don't separate : by a space on the left ("else :"). It might look cute, but almost nobody else does that. Try to be more consistent with those spaces all in all (line 6). == can be chained: number % 3 == number % 5 == 0 You don't need result: you can just return whatever you want when you want, yo More
Clean and simple one liner-dshorstein 2 1
Could be simpler, cleaner, _and_ use less memory if you removed the brackets. ''.join(letter for letter in text if letter.isupper()) BTW .istitle is not exactly the same. It is used when the desired output has only first letter of word emphasized by case. Although the test example gives exactl More
SavedText(list)-flpo 2
You can use a few more batteries. :-) More
two lines-VladBark 2
`''.join([...]) ~~~> ''.join(...)` More
Solved using only the random module-StackOfPancakes 2 1
LOL. Nice "inside the box" technique. But I can't make it work. Did CheckiO randomize some tests? Does it still work for you? More
generator-Sim0000 2
x for x in blah is probably nicer written as iter(blah). More
not smart but from beginner-b-612 2 1
For a beginner, it's pretty smart. ;-) But... blah if cond else 0 ~~~> blah * cond That's exactly what multiplication with bool does. More importantly, `words = words.split()` has no advantages (over just `for word in words.split()`) and many disadvantages. First, by rebinding the name More
Arithmetic-Sim0000 2 1
Don't ever index by index. Pythonic idiom for this is accessing a dict by key. (a, b, c)[(d, e, f).index(x)] ~~> {d:a, e:b, f:c}[x] Much faster (logarithmic instead of linear), shorter and more readable (keys and appropriate values are together). More
as simple as cooking popcorn-Tinus_Trotyl 2 1
Those two pops are endearing! :) More
Cheating :)-weerd 2 1
''.join and generator expressions would be much nicer solution instead of that C-like loop. (Not directly applicable since numbers are small, but might be interesting: [Schlemiel the painter story](http://www.joelonsoftware.com/articles/fog0000000319.html)) More