57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 11 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.
That inner while loop, with explicit x management, is unnecessary.
for letter, lnext in zip(word, word[1:]):
(you might want to end the zip earlier if your snake is too young:).
More
"<=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
> The shorter your code, the more remarkable you are.
Then I am https://remarkable.com/ :-D
More
Instead of giving my comments a shower of minuses, I think it would be much more productive to [learn some Python](http://www.checkio.org/mission/x-o-referee/publications/veky/python-3/trick-or-treat/). WETness of this code is staggering.
BTW, not everything is horrible up there. Last line is prett
More
OMG. Ok, you didn't know about math.gcd (nor fractions module...), but not knowing about builtin `abs` function is simply inexcusable. :-P
More
Nice. A few hints:
Adding four characters to line 1 would shorten your line by fourth. :-D
from itertools import combinations_with_replacement as C
Also, despite PEP8 (which you don't care about anyway:)
def checkio(data): return blah
can be written as _real_ one liner :-)
More
LOL. It's possible to be exact and _much_ simpler than this. But this is nice reading. :-D
More
Everything you wrote can be excused, except "Thus".
Seriously, if you're obsessed with milliseconds, you shouldn't write Python at all. You'll just be frustrated. There are much faster languages (where you can be obsessed about nanoseconds;).
More