57
veky
22 48 64 Leader of the month
44692/ 53887
Last seen 6 hours ago
Member for 11 years, 7 months, 3 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
Base 3-DiZ 2 1
Nice BFSolution. :-) Here are a few suggestions: list.pop(0) performance is much weaker than it needs to be (linear complexity). For a queue, it's much better to use a collections.deque, and .popleft from it. If you don't want to import collections, and your queue isn't using a huge amout of poplef More
First-RomanLubyanoy
This is a standard, and I hope intended, solution for this task. However, it's interesting to know that Python has a tool for specializing functions directly: functools.partial. So you don't have to define a new function, you just construct a partial object from sorted on key=abs, and name it checki More
If "000"-LuTze 1
A nice idea, but could be written much more directly. Check [this one](https://py.checkio.org/mission/three-words/publications/hrvoje/python-27/slightly-weird-solution/?ordering=most_voted&filtering=all) for example. :-) More
start in north-west, go probe-dist south, then go probe-dest east, then find compatible location with probe-dists-jmegner 1 1
Python is not Java. Not every API should be a single method of an ad hoc class. distance could be just a function. And calling it as distance(point1, point2) is more in line with commutativity than point1.distance(point2). (Not quite related, but useful hint: use math.hypot.) Alternatively, Python More
First-gorechi
elif can be handy. :-) And instead of keeping it all in a str, it's better to keep it in a list, `' '.join`ing it at the end. More
First-tranleanhthe 1
Python is not C. We don't need parentheses around if. :-) More
First-s_o_va
Too many indices! :-o But this is minor. Real problem is using 10 and 100 as magic numbers. Besides being maintainability hell (network expands, and in some random moment in the future, your code gives wrong results silently), documentation is lacking. Comments do help at the moment of assignm More
First-vkastala
Don't modify the list while iterating through it! It could spawn weird bugs. https://unspecified.wordpress.com/2009/02/12/thou-shalt-not-modify-a-list-during-iteration/ If you want a queue, use a `collections.deque`. More
First-vkastala
Missing/nonmissing spaces make this code ugly at a first sight. "curage" is probably misnamed, should be "current_opacity", right? Also, your fib generator is too complicated. Use tuple assignment for great good. :-) def fibgen(): a, b = 0, 1 while b < 5e3: a, b = b More
First-saibotshamtul
It's ok, but if you use cmath, you'll see that there are no different cases. :-) Also, why name something `r` (an empty name, probably for "value to **r**eturn") just to return it immediately afterwards. Especially at the end... just return [round(func(a, c), 2) for func in (v, sa)] But of co More
SlopeInterceptDict-saibotshamtul
There are many weird things in your code, but I'll ask just this: why are you stringifying your keys? `si` returns a tuple of floats, which is perfectly usable as a key. More
First-tarjeii 1
It is a standard backtracking approach, with labyrinth used as a scratchbook for algorithm state. The main thing that could be improved is the ugly repetition of code. A for loop over a dictionary mapping directions to offsets would be much nicer. And the extra benefit would be that the comments 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
A*-PositronicLlama
https://www.youtube.com/watch?v=o9pEzgHorH0 There is really no reason for a class here. More
The Good, the Bad and the Ugly -angapov 2
1. Revolver can be derived from collections.deque with maxlen=6, thus giving you loading logic for free. 2. Those triple-quoted strings are an abomination. Use textwrap.dedent, or just use "\n" like a normal person. :-) 3. A bug: chew_cigar doesn't reduce the number of cigars. 4. Those enemies co More
Unexceptional-veky
I finally got my `yield from`. :-D More
First-pubbin
`for spam in map(xform, eggs)` is almost always an antipattern. You're packaging one iteration into an expression, just to evolve it in a suite right afterwards. Since you already have a suite, `map` gives you no ROI. :-) for word in words.split(): if word.isalpha(): ... More
Leanfast!-pubbin
Why `and array[-1]`?? Special cases are not special enough. More
Concise-pubbin
Nice. Reminds me of definition by cases. :-) Of course, in LaTeX you would have `\\` instead of single `\`. :-D More
A concise solution-ruikang.dai 1
If you call this concise, you have a long way to go. ;-X More