57
veky
22 48 64 Leader of the month
44583/ 53887
Last seen 16 hours ago
Member for 11 years, 6 months, 6 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-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
Like pulling teeth-gileadslostson 2 2
You're aware that you wrote the same thing three times? :-) More
iter-Sim0000 2 1
How about `swap_nodes([1, 0, 3, 4])`? I don't think that's what you wanted. More
Reverse Thinking-bukebuer 2 1
Very simple, and I'm actually surprised it works. :-) Few details: line 6: "continue" would much better fit here instead of "pass". Then "elif" in line 7 can simply be "if". Or just reverse the logic, "if n in target:", and then nest another condition. The best, of course, is to use EAFP. Just More
Lame lookup-macfreek 2 1
You could have had even less code here: checkio = { ... # your wonderful dict }.get ;-) (I know that's not your main point, but it is a point: code is practically nonexistent here.) BTW, see my solution as an antithesis to this: maximizing code, minimizing data. :-) More
yield from explore-veky 2
I've seen that many people look for my solution of this mission, and they only find the horrible code I've written about three years ago, when I first solved this mission. I think it's a shame. In the meantime, both I and Python have become much better, and this is the result. :-) More
Head, *body and tail.-Tinus_Trotyl 2 1
You can use * in the ''.join, too. ''.join([head.upper(), *body, tail if ...]) More
Yield!-LukeSolo 2 1
LOL. I'm beginning to like you. You have some potential. ;-) (Of course, you're aware of bin builtin? Just checking...) More
Shortest? 52 - Kill me now-StefanPochmann 2 2
https://www.youtube.com/watch?v=sn4BqpI1p6E :-D More
oneliner-tivvit 2
Why [0]? There is no char in Python, just str of len 1. Just as there is no "digit", just a single-digit int. :-) And don't aggregate over listcomps. Drop the [] inside .join(). More
completely_empty = lambda *args: globals()['completely_empty'](*args) .....-flpo 2
Next time someone tells me Python is a functional programming language, I'll show them this. :-DD More
All the Romans (there are no romans left)-oduvan 2
You could have just slapped `functools.lru_cache(maxsize=5000)` on your `dec_to_rom` and call it `checkio`. :-P More
First-lsdda 2 1
That counting from 1 at every step feels forced a bit. Python naturally counts from 0. For "a in bla1 and b in bla2 and c in bla3"... you might wish to learn about sets. Precisely, sets of tuples. In your inner functions, you don't need lines like 25 and 26. Python returns None by default, whi More
First-minto 2
w(y,1+i,13)==4 for i in range(12) same number of characters, but easier to read IMO. Of course, the true portable solution is calendar.January + i :-D If you really want to have as few hits as possible, a month has Friday 13th iff it has Friday 6th. And 6 is shorter than 13. :-) More
Documented code, with list comprehensions-marat.m 2 1
Specialcasing what shouldn't be specialcased, sorting to find the minimum, list "comprehensions" which do nothing at all... :-/ A perfect example of how you can't fix the bad code by documenting it. :-] * What's wrong with treating 0 the same as all the other numbers? * Imagine you have a thousan More
First-ilih 2
I don't see what's so funny in binary addition. More
First-shota243 2 1
Cool. Especially the - grid[row][col] part. ;-) In slicing, max is unfortunately necessary, since -1 has a different meaning. But min isn't necessary. r[max(0, col-1):col+2] works fine. More
Radiation eater-LukeSolo 2 1
Line 21 would probably be easier to parse if you'd filter a set to get a set: {(x+1, y), (x, y+1), ...}. And when you see this, it's even better to write do\_not\_hurt as a _set_ of possible indices, and just intersect your set of offseted positions with it. Also, when you have a set of possible in More
First-theholy7 2 2
You can drop the []. "".join(l for ...) is clearer, more direct, uses less memory, and potentially faster. 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