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
First-mr.floppy
Ok, now try to be honest. _What_ do you think these continues do? They don't speed up the code, that's for sure. :-) BTW ever heard of elif? More
First-mr.floppy
Suggestions? Of course. Factor out the duplication into a separate function. And then make it one line if you want. ;-) More
First-mr.floppy 1
What you really need is += datetime.timedelta(1). But since you already use fromordinal and toordinal, wasn't it easier to iterate through the ordinals instead of dates? And a nitpick: what do you think line 1 is doing? (This is a frequent misconception in Python... it's completely unnecessary. Yo More
First-mr.floppy
Nice, but one big error. If angA and angB are rounded, the third angle (rounded) is not necessarily 180 - angA - angB (in degrees). For example, 59.6, 59.7, 60.7. More
First-mr.floppy
"if len(myStack) > 0" is just "if myStack". Lines 23&24: see list.pop. You will be delighted. ;-) What do you think lines 18~20 and 25~27 are doing?? :-o Those comments are at best unnecessary, and at worst wrong. Don't repeat yourself, especially if you're doing this in two languages: Python and More
First-mr.floppy
About that rjusts... see str.zfill. Much nicer and more explicit to work with. That i at the end... please learn to use enumerate. Much easier to avoid one-off errors, and more readable. Also, use list comprehensions instead of writing back something entirely different to the same place. Also, why More
First-mr.floppy 1
Not really original. :-) Also, you might want to read on eta-reduction. checkio=sum, for example. :-) More
Simple Math-panagiotakis.al
Your simple math could be simpler. ;-] More
Second-chaz.ruhl 1
Why + ".*"? Really no reason for that. And of course, "in" works perfectly fine with str. No need to import heavy machinery of re. More
First-gyahun_dash 1
Cool. But don't you think there's an easier way to do what you do in lines 16~18? Also, condition in line 12 is more usually written as "if not shortages". More
First-shunsk2017 1
Aaargh! :-D If this wasn't in Clear, I'd even give you a few thumbs. ;-P More
The operator module-EnCuKou
ROTFL. P.S. Even I'd never be so bold to import * from operator. :-D But you handle it excellently. :-) More
brainf**k_nonlocal-ciel 1
You don't need nonlocal. buffer doesn't have to be nonlocal at all (since you don't rebind it), and ptr can be just an argument. def BF(s): buffer = ... # how about defaultdict(int)? Much cleaner. def execute(s, ptr=0): ... ... ret += execute(s[i+1:], More
First-kenaniah
Cool usage of sum of slice, but please use // instead of math.floor and division. More
First-kenaniah
Last line is much nicer written as return not stack. You can avoid None contortions by having a sentinel value at the bottom of stack, see my solution. ;-) (Or at least you can write "if not stack or char != closed[stack.pop()]:".) I don't really get why are you filtering brackets as a separate s More
First-kenaniah
You can avoid global res if you use nonlocal (remove lines 1 and 3, and change line 6 to "nonlocal res"). You can avoid even that if you pass [res] as a parameter (with a default value). Otherwise, yes, list of map is a standard for loop replacement (only you get a pile of Nones in the process, whic More
First-kenaniah
str(int(field) - 1) can also be replaced by chr(ord(field) - 1). Then that code can be extracted as a separate function. :-) More
First-kenaniah
In this case, str has a method that's much nicer to use than .split. It's .partition. You get your parts as separate variables, being empty if nonexistent. instr, _, arg = command.partition(" ") Then you just use instr and arg instead of parts[0] and parts[1]. Much more readable. Also, please More
First-kenaniah
If you know about max with key, you can really solve this task in a much more direct way. max(string.ascii_letters, key=text.lower().count) "import collections" is probably a relic from using Counter. Remove it. :-) More
Would have been fast in C-kenaniah 1
Oh, please don't. :-) Fastest in C is not fastest in Python. Please read [this discussion](http://www.checkio.org/mission/hamming-distance2/publications/veky/python-3/publication/). More