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
Second-rojeeer
You don't need parens around lambda: lambda is it's own left paren. :-) opt is a weird name (I think you're again calling it by implementation, not by meaning;). `cmp` would probably be better (in Py2 a very similar argument was really called `cmp`). In fact, name `inner` has the same problem. "ex More
simple-petrch 1
"<=1" is a cute and completely unnecessary "optimization", that's really hard to grasp at first. You could just say "if not args" in line 2 (or "if args" and reverse returns). In newer Pythons, you can also put default kwarg in min and max, eliminating the need for if totally. BTW you don't need * More
step by step-petrch 1
That "print( c )" wasn't very helpful, right? :-) In fact, your steps can be much more pythonic. b = words.split() c = ("10"[x.isnumeric()] for x in b) d = "".join(c) return "1"*3 in d Whenever you're mapping lambda, you should use a generator. map(lambda arg: expr, seq) ~~> More
Hardest Code I never coded-kranked_354
You might love Python, but you obviously hate me. I see what you're doing, but I don't see what you're trying to accomplish. It's probably so obvious to you that you didn't even consider the possibility your motive wouldn't be understood. Can you articulate your message? Even terrorists make some k More
Evil pop-tarjeii
ROTFL. :-) Clear, no doubt. :-P Wouldn't str(tuple(evil)) be clearer? Then you don't need .pop, and you're not depending on the type of evil. BTW, you can .replace(*',+') for added puzzlement. Replace multiplication prime with addition prime. ;-D More
First-santosh.pagare
Line 9 surely shows some misunderstanding of how Python works. What did you think it does (as opposed to just "return data_new")? And of course, you can just write a list comprehension. return [x for x in data if cnt[x] > 1] More
Striped Words-santosh.pagare 1
This is a perfect example of how deeply unpythonic regexes are. That line 6 seems like it has fallen from some wholly different planet (named Perl, incidentally:). BTW, sum(regex.match(element) and not re.search('\d+', element) for element in re.split('\W+', text.lower())) More
if someone did this in one line.... -andrewg12
Does [this](http://www.checkio.org/mission/count-inversions/publications/veky/python-3/gallery/?ordering=most_voted) count? :-D [Yes, pun intended.:] More
Shortest? (54)-StefanPochmann 1
LOL, wonderful. :-) Giving start index without end index to endswith is just beautifully weird. :-D More
XOR-StefanPochmann 1
I have a feeling I'll like your solutions. :-D More
So Quick!-andrewg12
Great. Now learn about if-else expression. ;-) More
Learning Syntax-andrewg12
You can return it as soon as you have it. if number%5 == number%3 == 0: return 'Fizz Buzz' More
Cant wait to see how you guys did it!-andrewg12
I think [this one](http://www.checkio.org/mission/digits-multiplication/publications/blabaster/python-3/golf/?ordering=most_voted) will floor you. :-D Also, // (and divmod) might be nice to learn. while number: number, digit = divmod(number, 10) if digit: product *= digit More
Moving on up!-andrewg12
See str.endswith. Your reinvention of it is very entertaining BTW. :-D More
THAT SOLUTION THO-andrewg12
What you did in first two cases, you can do in others, too. elif operation == 'implication': return not (x == 1 and y == 0) elif operation == 'exclusive': return x + y == 1 elif operation == 'equivalence': return x == y Those OPERATION_NAMES repeating are not giving you anything. Much More
I think this is the best!-andrewg12
Best compared to what? :-) You can have just one expression, ','.join(phrases).replace('right', 'left') And then you can just stick left_join = lambda phrases: at the beginning. :-) More
Crushing it!!!! -andrewg12
This is beginning to look a lot like Python, to paraphrase that old Christmas song. :-D The only jarring thing is that name in line 2. Just inline it, man. for word in words.split(): More
str-DiZ 1
Wow, what a cheat! :-D Of course it doesn't always work, but still very nice. Instead of (second) str, you can use id. It is false in rarer occasions. ;-] More
First-jake-g
def checkio(from_date, to_date): """Count Saturdays and Sundays between dates.""" weeks, days = divmod((to_date - from_date).days, 7) nd = from_date.weekday() + days # next same weekday as to_date return 2*weeks + (nd > 4) + (days and nd > 5) Same algo, 4 times More
First-ignalion
[since CiO will probably never get back links to commenter's solutions :-(, [here is the link to mine](http://www.checkio.org/mission/mind-switcher/publications/veky/python-3/zendoh/?ordering=most_voted), for comparison. This is a reply to ignalion's comment on my code.] While you might think our s More