57
veky
22 48 64 Leader of the month
44583/ 53887
Last seen 16 hours ago
Member for 11 years, 6 months, 6 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-tofguerrier 1
Nice and clear. Of course, Py2.7 is complicated with having to be forced to float division, but still, 12. and 60. in the divisor might be better than H = float(H) and M = float(M). Also, H %= 12 is a nicer way to write that if. More
while & if-Pytato 1 1
Lines 10, 11, 12 and 13 are just return max(wheat, pigeons) Also, I know you know about +=, since you use it in line 8. Use it also in line 14 (and use -= in line 7). Thirdly, condition 0 > a - (b + c) is really weirdly written. It's really just a < b + c. Fourthly, lines 3 and 4 can More
dict & list-Pytato 1 1
You might wish to study str.zfill and dict.get methods. But especially the first one. ;-) u, t, h, T = str(data).zfill(4) You can even "map(int," over them, but that might be too advanced. :-) More
Second-santosh.pagare 1 1
Yes, that's better. :-) Though you still accomplish precisely nothing by rebinding data locally just before you return it. ;-] More
First-santosh.pagare 1 1
Lines 4,5,6: digits = lowers = uppers = 0 Line 1: unnecessary. :-) Lines 8~13: digits += c.isdigit() lowers += c.islower() uppers += c.isupper() or if you insist on using unbound method, remove initialization and just say digits = sum(map(str.isdigit, data)) Lines 15~18: More
Easy recursive-mombius 1 1
You don't need to have so many special cases, det of 0x0 matrix being 1 is enough. Also, p in lines 17~18 is just (-1) ** i. More
Sum of chr-DiZ 1 1
Funny, this is exactly the same length: safe_pawns=lambda p:sum(bool({chr(ord(c)+o)+chr(ord(r)-1)for o in(-1,1)}&p)for c,r in p) More
First-PositronicLlama 1
Very high level code. Exact, documented, with references. I like it. BTW line 28 made me laugh. Avoiding code duplication at every price. :-D More
the obvious way-tivvit 1
Line 6: `if number % 5 == number % 3 == 0` More
First-tivvit 1
First, really too many cases. Second, "if blah != 0" and "if blah > 0"... could really be just "if blah". Third, use divmod. It will be _much_ simpler than what you're doing (lines 20~21, lines 48~49,...). More
First-Sim0000 1
Line 8 is the most important one. :-D More
First-tivvit 1
Lines 4~6: `islower = isupper = isnumeric = False` Lines 16~19: `return isnumeric and isupper and islower`. In fact you can just add `and len(data) >= 10` and eliminate lines 8, 20 and 21. More
Permutations-Ch0bits 1
That's an ok solution. However, it would be much nicer (faster, shorter, less memory, more readable, more Pythonic) to use generator expression instead of list comprehension. Just drop the brackets []. ;-) More
Too eager ;-)-veky 1 1
Why is '00:45' not a problem for .lstrip('0')? ;-) More
oneliner-tivvit 1
Cool. :-) In modern Pythons, you can use max(...,default=0) (and min). More
First-colinmcnicholl 1 1
You're writing docstrings on the wrong side. :-P Also, that action at a distance via changing retlist is much more naturally written using a generator. More
Simple-Taca 1
You were very close with that "key". ;-) return max(sorted(map), key=map.count) Also, you don't need re. You can just use "abcdefghijklmnopqrstuvwxyz" (also known as string.ascii_lowercase) as first argument to max, and key=text.count as second. But then it's too easy. :-D More
oneliner list comprehensions and dict-tivvit 1 1
Decorate-Sort-Undecorate is sooo last century. :-P The most ironic is that you _do_ use key. :-D More
all(iterable) == True if iterable is empty-rossras 1 1
Well, what would you expect? FILE_NOT_FOUND? :-D (https://thedailywtf.com/articles/What_Is_Truth_0x3f_) More
First-tivvit 1
Nice. Of course, can be expressed with any. any(word.endswith(suffix) for suffix in words_set for word in words_set - {suffix}) Or itertools.permutations, if you're in the mood. :-) More