57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 9 minutes 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-xiaozhan 1 1
Nice. BTW squeezed-space operators like ** and even > can be ok, but after the colon there should really be a space. (Unless you're golfing, but in that case you can save a lot more chars - even spaces.:) More
First-xiaozhan 1 1
First, don't map lambda, use genexps: tuple(map(lambda x: number%x == 0, [3,5])) ~~~> tuple(not number%x for x in [3,5]) (Also, as you see, not is smart and can be used here for greater readability: 'there is no remainder'.) Second, in last line, that pattern is clearer coded using dict.get: More
First-fishiwhj 1 1
Line 18 is wrong. rounded gamma is _not_ necessarily equal to 180 - rounded alpha - rounded beta. BTW why do you reinvent the wheel (in this case, builtin round function)? More
namedtuple-Sim0000 1 1
namedtuple('complex', 'real imag') is better, it supports more operations. ;-) More
Second, controlled oversampling (more effective)-Tinus_Trotyl 1
Wasn't it easier to do that `set(connection.split("-"))` thing only once? :-) Also, `break else return` is a powerful pattern that's better than bool flags. See [my solution](https://py.checkio.org/mission/find-friends/publications/veky/python-3/tinus-trotyls-pythonified/) for implementation. :-) More
First-pohmelie 1 2
Line 17 is really pointless. :-) You don't need zip inside map. map(sum, p, dp) is ok. Start of line 23 can be written: np in m.keys() - visited. Not very useful here, but good to know: keys is a set-like object. More
64 chars-Sim0000 1 1
Mine is shorter, mine is shorter... :-P More
truth table-shota243 1 1
ROTFL. But it would be way more cool if you mapped OPERATION_NAMES to symbols from "∧∨→⊕≡" instead of relying on indexes. This is not maintainable. ;-P More
Cycle detection-DiZ 1 1
Yup, that's the one. If elements of r are only pairs, it's simplest. Though it seems not the shortest. ;-) break_rings=lambda r:min(map(len,map(set,__import__("itertools").product(*r)))) More
Newton method-Sim0000 1 1
Have you tried counting iterations? You might be surprised. ;-P More
First-mroth 1
It's funny how your naming quickly deteriorated from most_wanted_letter_alpha # wow, I'm feeling so powerful to a # ah, to hell with it already! :-D More
First-vladislav.bezugliy 1
And then people tell me that there's no harm in teaching students bubblesort in 21th century. :-/ Well, at least you didn't write digit extraction (converting int to str) manually. ;-] But still, sad. More
First-Nguyen_Dang_Thai 1
OMG... if this is clear, I am a marsupial. :-P More
split, join-kurosawa4434 1
Seriously? You import findall from re just to find out whether `path.startswith('/')`? :-) More
First-mlahor 1
Line 3 (together with line 16) is such an ugly hack that I'm considering boycotting your solutions. :-P What you're looking for is a len builtin. Comparisons can be chained. 'if "a" <= c <= "z"', or even better, 'if c.islower()'. Many names can be given to the same thing: "digit\_count = upc\_lett More
First-mlahor 1
Why the exception at all? If the text contains no English letters, it's obvious that "a" satisfies all conditions for the return value. ;-P Relevant quote from Zen: Special cases aren't special enough to break the rules. Don't invent counter strategy from scratch (well, from dict:). Instead im More
bad but surprise-magdre 1 2
What's bad and what's surprise here? (except CiO Python finally supports yield from:). I consider isinstance(x, list) a bit nicer than type(x) == list. And it will work for subclasses of list too. ;-) More
First-mlahor 1
Nice, but here are a few tips: "D" doesn't really make sense as a return value from check_sequence (what would it mean for a diagonal to be "draw"?:), and it shows in code. Much better would be to just not return anything, and rely on the fact that None is false, while "O" and "X" are not. So: 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
First-n_ara 1 1
Standard string concatenation approach. For longer messages, you should be aware of the "Schlemiel the painter" danger (you construct new strings again and again, longer each time), but for short messages (in this task, len is at most 1000) it's ok. More