57
veky
22 48 64 Leader of the month
44668/ 53887
Last seen 15 hours ago
Member for 11 years, 6 months, 23 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
Comprehend-veky 1 3
Since people have asked me how would I write the same solution if I was writing professionally, here it is: http://pep8online.com/share/51fc1a526cee1659c2a34a0f You can probably see that the algorithm is completely the same. The only thing that's different is documentation (annotations, variable More
First-RomanKorbutyak 1 1
LOL @ `reverse=False` part. :-) You know False is default here, right? More
First-Reuborz 1
Aargh. Too many cases. My head hurts. :-/ Many of these conditions can be checked mathematically instead of constructing lists and checking containment. E.g. line 31: "if not number % 100:" str_number[1]+str_number[2] is just str_number[1:3]. Or use "slice twice": str_number[1:][:2] (from inde More
First-RomanKorbutyak 1 1
`str` is superfluous here. `bin(number)` is already a str. More
vefan-veky 1 1
I put those chars @StefanPochmann generously provided me to good use - traded them for spaces at a favorable exchange rate. :-D [Of course, now someone will make a 'vfn' solution without spaces. But that's just too predictable.:] More
First-Janoo12 1
Your spaces are a bit inconsistent. At least put space after `*=` if you put it before. Also, if you `int(n)` before, it would be easier to write a condition: d = int(n) if d: result *= d More
Python is cool :)-sirmax 1
> Python is cool :) You have no idea. :-D First, you don't have to write your uppercase. Just from string import ascii_uppercase Also, that if can be much better placed _after_ for. Then you don't need singular else. ''.join(ch for ch in text if ch in ascii_uppercase) And of course, th More
First-a7295177 1 1
BASE.find(str_number[i]) really could be factored out. Instead of that ugly index manipulations, you can use enumerate (and possibly reversed). More
First-RomanKorbutyak 1 1
`if len(args) > 0` is unpythonic. Just use `if args`. Or, if you really want to use len(args), use it interestingly: len(args) and max(args) - min(args) ;-) More
First-xiaozhan 1 1
:-) If you're going to use `len() and`, you can use it in at least two other missions. Try to find them. ;-] More
First-RomanKorbutyak 1 1
As I said already, drop [] inside (). You don't want to make a list just to ",".join it. You just want to ",".join values in order. More
21-liner: first proposal with no bechmarks-przemyslaw.daniel 1
You're reinventing [the wheel](https://docs.python.org/3.9/library/heapq.html#heapq.nlargest). More
One-liner-a7295177 1 1
Nice idea, but really too complicated implementation. See: checkio=lambda t:3*"True"in"".join(str(w.isalpha())for w in t.split()) More
scipy.sparse.csgraph.dijkstra-juestr 1 1
Yeah, preparing the grid into a graph for Dijkstra is a lot of work. It can be shortened somewhat by factoring those things that are repeated for all four cardinal directions, but it's not easy. In most places where you can use a tuple, you can also use a list, which helps when it is a 1-tuple, for More
First-RomanKorbutyak 1 1
Why all these conversions tuple -> list -> tuple ?? Just have a list if you intend to mutate it. More
First-martin.beseda.3 1 1
Line 1 expression can just be "secs // 60 + (secs % 60 > 0)". bool _is_ int. ;-) That antipattern in lines 10~13 really should have been using collections.Counter. Learn about it, you'll love it. ;-) Lines 16~19 are _precisely_ the reason why Guido finally added conditional expressions to Pyth More
First-martin.beseda.3 1
When a loop has 4 lines, one of which is "continue", that's surely an overkill. :-) "if word != w and word.endswith(w):" is obvious solution. "for w in dic - {word}:" is a clever one. ;-) More
First-martin.beseda.3 1 1
Wow. Until now, I thought you came from Perl land, but now I'm not so sure. Very few of these people know about accumulator recursions. :-) More
First-RomanKorbutyak 1 1
`not x>y` is `x<=y`, and `not x==y` is `x!=y`, right? :-) Python's switch is usually not a huge if chain. It is a dict. dict( conjunction = x and y, disjunction = x or y, ... )[operation] More
First-RomanKorbutyak 1 2
Khm. No need to enumerate the whole square when you just need the upper triangle. Slice it, man. :-) for late_index, late_val in enumerate(sequence): for early_val in sequence[:late_index]: res += early_val > late_val `res` would probably profit from being called `inversion More