57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 21 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
while chunk yield chunk-veky
If you're wondering how people wrote that pattern before walrus, check out my other solution. ;-) More
Just math-rossras 1
That loop hardly qualifies as math... you could have used recursion then. 🤓 More
Flatten a list-svartmetall 1
You should use the Smart Split (without an argument). That way you don't need `if array else []`. More
very clear lambdas-fishsouprecipe 1
It can be even clearer [without them](https://py.checkio.org/mission/boolean-algebra/publications/veky/python-3/an-operator-by-any-other-name/). :-] More
Solution for float input numbers-archius11
This is a beautiful algorithm. Too bad it's written in Java, not Python. :-P :-D More
pythonic-ibonyun
Here is a Veky's five for you. :-) More
Standard using of Observer Design Pattern-von.Oak
There really is no reason for observers being a list: a set is much more appropriate. More
Chuck Norris Constant-r.bathoorn
Instead of +1, you could have used the second argument of sum. And instead of that ord business, you could have just sum the bytes. ;-) [See the "Happy New Year" thread on the Forum for details.] More
In a galaxy far, far away...-veky 1
Question: which galaxy? ;-) (Hint: "a long, long time ago" is precisely 39 years ago;) More
match & munch-veky
A cool and very hard exercise: what is the maximum recursion depth this solution can have, given the preconditions of the task? :-> More
Stars aligned-veky 1
`else: return r`s misaligned. ;-D More
Myopic :-(-veky
An interesting question: why are parentheses needed? A more interesting question: were they needed in all previous versions of Python? ;-) More
Nested is faster than flat.-veky 1
Of course, the len checking can be done in the same way, at the expense of blowing up the code by a factor of at least 2. But that's even more wrong than this. :-D More
Cloud number... -veky
Are the clouds numbered starting from 0? Or 1? :-D More
... unless you're Dutch.-veky
There are some weird things going on here. For example, I thought Python doesn't have a character type (different from str). I bet you thought so too. Yet look at line 20. Calling ord('aa') raises TypeError, calling ord('a') doesn't, but they are of the same type. It seems Guido didn't really mean More
First-Fedorovich
You can chain comparisons. if number % 3 == number % 5 == 0: Nice to know but not really needed: you can use not % without parentheses (as opposed to C). if not number % 3: More
First-Fedorovich 1
_Why_ did you think you needed line 2? You Py2 folks are so obsessed with lists, it blows my mind. :-D Also, line 4 is just "if args:". And you don't need () after return. More
First-Fedorovich 1
Ok, but that prints are cluttering your code. It's ok for debugging, but remove them before publishing. More
First-Fedorovich 1
Line 10 is really interesting. Remember, "special cases aren't special enough". What could "".join([]) do, except give empty string? Why do you think it's a special case? Line 7: of course, there is .isupper(). But if you really need "ABCDEFGHIJKLMNOPQRSTUVWXYZ", you can use string.ascii_uppercase More
First-Fedorovich 1
Line 4 should be removed, and once you remove it, you see that you don't need line 3 either. Just say for word in words.split(): (don't you think "word" is nicer name than "item", for something that iterates through "words"?:) "!= True": ugly. Python has a "not" keyword. Or you can reverse lo More