57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 2 hours ago
Member for 11 years, 6 months, 7 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
"myNum"? That's, like, a subexpression name that facilitates understanding of code? :-p Also, isn't number already an int? More
with Sets-mr.floppy
Cool. You might wish to know that setA & setB is a nicer way to write .intersection(). Also, why not just call them A and B? Please don't use Hungarian notation in Python, it doesn't really make sense. More
First-mr.floppy
Cool. Might be even more factored using functools.partial. ;-) 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
with regex-mr.floppy
Nice. :-) You might want to use all instead of these ands, though. More
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
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
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-binilnilquad
Those two if-elses are unnecessary. If you really wanted to handle the case of empty data (despite the precondition), you could have done it like this: if length % 2: ... #handle the odd case elif data: ... #handle the even case elif is useful, empty list can be sorted trivially, and pytho More
classic dp -sndnyang 1
Lines 13~16 (and maybe others;) can be replaced with just one. Builtin max is your friend. ;-) More