57
veky
22 48 64 Leader of the month
44618/ 53887
Last seen 13 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
First-MBM_1607 1 1
You don't need those backslashes (except the last one, unless you add another pair of parentheses), and you can indent the subconditions accordingly to their grouping/priority. 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
Queueing-veky 1
I didn't think I'd ever post an [NSFW link](https://xkcd.com/853/) to CiO, but there's a first time for everything. :-D More
clean(cryptotext).translate(cipher(delta))-flpo 1
Yes, you should use string.translate. But you should use [all of its capabilities](https://py.checkio.org/mission/caesar-cipher-decryptor/publications/veky/python-3/punctuation-as-junk/?ordering=most_voted&filtering=all), not fall back to regex for such a simple thing as deleting extraneous characte More
First-splinter12345 1 1
Again, sum is a builtin: sum(array[::2]) is what you need. Also, you don't need len(p) inside p[]: array[-1] is ok. Space after :, but not before :. Nice EAFP way. ;-) More
First-Franky 1
`self` is a weird name in this context. :-) That duplication of code for rows and cols... wouldn't it be much nicer to write a function? for i_row in around(row, len(grid)): for i_col in around(col, len(grid[i_row])): yield grid[i_row][i_col] In fact, by using slice instea More
First-Franky 1
`ele` is a weird abbrevi. :-) They usually don't end with a vowel. Making a new list (via comprehension) would probably be easier than modifying the argument. And if you really wanted to iterate through a copy, saying `.copy()` is probably clearer than `[:]`. More
clear_cut-TomTerebus 1 1
hash? Ah, I should have known it. You came here from the Kingdom of Perl. Noone else would check for substring using regex. :-D That being said, study collections.Counter and don't invent the wheel all over again. :-) Line 14: m = max(count_dict, key=count_dict.get) keys.sort(), then return keys[ More
First-Tidjei 1 1
I took the liberty of rewriting your code in True Python: def CC(DL): """Rings connected with least-connected ring""" res1 = {i1: sum(i1 in i2 for i2 in DL) for i in DL for i1 in i} res2 = {i for i, v in res1.items() if v == min(res1.values())} return {t for i in More
17<<16-veky 1
Of course, sys.maxunicode would be much more clear, if only CiO weren't so paranoid. :-P More
First of The square chest-grigoriytretyakov 1 1
inside is just `max(divmod(top-1, 4)) < 4 - length`. And set([spam for egggs]) is `{spam for eggs}`. And if you return a set(sides) from square, you can just use subset operator (`square <= lines`) in the last line. 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
write on screen-kurosawa4434 1
This one is the most similar to mine, I guess. But still a bit more complicated. :-) More
First-StarkyLife 1 1
Line 4 doesn't serve any purpose, you know? :-) In fact, you can just return the expressions from lines 6 and 8 directly. But it's nice to name at least the return value, when the function name is totally uninformative. ;-) "!= 0" can be removed from line 5. Read it as "if there is a remainder". I More
Shuffle the points!-hrvoje 1
Not bad. Handling singular cases is cool. :-) You might want to use some of Python's batteries, though. For example, for a, b, c in itertools.permutations(eval(data)): with contextlib.suppress(ZeroDivisionError): ... lines 7 ~ 12 ... lines 17 & 18 seems much ni More
Second-Sim0000 1 1
Lot can be factored out from this. See my solution. ;-) More
endswith(tuple)-james.verran 1 1
Bravo! I thought about how to use that wonderfully weird API with endswith(tuple), but didn't figure it out. Of course, .pop before and manual loop was the solution. BTW you don't need "list" in line 2. More
First-Sim0000 1 1
Nice documentation in the comments. ;-) More
phi number, golden ratio-kdim 1
https://www.maa.org/external_archive/devlin/devlin_05_07.html More
binairy tree climbing-Tinus_Trotyl 1 1
Mine is the same, only with less boilerplate. :) More