57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 12 hours ago
Member for 11 years, 6 months, 24 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
The Most Numbers-lunaoesed
Again, min and max are purple. What does it tell you? ;-) Also, line 4. "if args:". More
MonosLocos-lunaoesed
"a.count(b) > 0" is just a very convoluted way to say "b in a". Also, please drop the semicolon. Your C is showing. ;-P If you want to somehow group lines 2 and 3, it's txt, cnt = text.lower(), 0 And be a bit more careful with names. First, you don't have to name everything, and second, names More
arreglos1-lunaoesed
Waitaminute. Not even a C programmer would use _that_ many parentheses. Do you maybe come from The Tower of PHP? :-O More
Secret Message-lunaoesed
Here it doesn't matter much, but be aware of [Schlemiel problem](http://en.wikipedia.org/wiki/Joel_Spolsky#Example). ;-) More
Array join-geruz
Also, drop the [] inside "".join. Here it doesn't matter much, but it's better to get the right instinct. There is no need to iterate through list(text)... "for c in text" is completely fine. Not everything is a list (and why do you call it array??:). More
I want to ride my bicycle-LukeSolo 1
Quicksort is nice. But list() is unnecessary, again. :-) More
Pretty simple-LukeSolo 1
Why the alias? Pythonic way is calling the constructor same as the type. You don't say to_int("34"), right? ;-P More
Simple-geruz
Since "," not in "right", you can replace after joining. It would be shorter. ;-) More
First-emnkugler
You're fascinating. May I ask _what_ did you think when you wrote line 6? :-D More
More than one obvious way?-tarjeii 1
Your WET (Write Everything Twice, antonym of DRY) approach is fascinating. :-P DRY = lambda canon: lambda w1, w2: canon(w1) == canon(w2) @DRY def v1(word): return ''.join(sorted(word.upper())).lstrip() # v2, v3, v4 left as homework. ;-) verify_anagrams = lambda *a: v1 More
First-oglop
Those names are weird. I suppose `div3` (as in, "divisible by 3") would be much better. `mod3` would mean the remainder itself, and that surely is not what you're after. Of course, you can factor it out: div3, div5 = (not number%k for k in (3, 5)) Also, you can use namespaces here too: d More
First-oglop
You can name that False 3 names in one statement: has_digit = has_lower = has_upper = False (And spaces around `=` assignments are really good for easy reading. *Sparse is better than dense.*) Or, even better, "*Namespaces are one honking great idea -- let's do more of those!*": has = di More
my first exception usage!-oglop 1
... and you're even using it correctly. :-D (Although that lonely `return` in line 11 is weird.:) [Of course, you know you can write `array[n]**n`?] But a more important thing: that docstring. You're doing it wrong. :-) https://www.python.org/dev/peps/pep-0257/#one-line-docstrings More
First-Franky 1
Since you obviously know about `key` kwarg to max (and sorted), it's a mystery why didn't you just return max(letters, key=text_lower.count) And of course, you could from string import ascii_lowercase as letters And you don't need text_lower, text.lower() is equally readable. :-) More
Second-Franky
I must say I don't understand what are you doing here. Read once more what I've written. What do you think letters.split() is doing? Try it in interactive shell. And your "new" function is never actually seen by the testing engine, since right below it, you have the "old" function which redefines More
seems to be pythonic :)-oglop
Sorry, but doesn't. mapping lambdas doesn't make sense when you have genexps: all(map(lambda x: cond, seq)) ~~~> all(cond for x in seq) Simpler, shorter, more elegant, and faster. Also, from string import ascii_lowercase as alp But you already know that probably. :-) More
First-Dlown
Again, too wordy and with strange names (from the perspective of English, `result` is much more common). But generally ok. More
Median-Vincent_Fan 1
Don't use int for truncation, it's bad style (Guido tries to deprecate such usage). When floordividing, use the dedicated operator: `n // 2`. Even better: since you need both // and %, why not acquire both at once: half, odd = divmod(len(data), 2) if odd: return sum(data[half-1:hal 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