57
veky
22 48 64 Leader of the month
44668/ 53887
Last seen 15 hours ago
Member for 11 years, 6 months, 23 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-jcg
,key = lambda x : (x[0],x[1]) isn't really needed in line 32. More
First-gflegar
Last line is just return s*(n == 1) And yes, you could have get rid of that special case (given your hate for special cases) in line 2. For example, return (s + (not s))*(n == 1) Here you do need parentheses around not, since it is special in grammar. But "not" being special enab More
First-gflegar
Again, no parentheses around "not s" are needed. You never need them when you use it as a logical condition, only as an arithmetical expression. BTW sentinel really could have helped here (to reduce number of cases:). See mine. ;-) More
First-qria
Line 3: nice optimization, but it's not like we have millions of elements. list.index would work perfectly fine. :-) Line 5: str is also just a (kindof) list of characters. "qria" is probably more readable than ["q", "r", "i", "a"]. Lines 37~40: you _should_ feel bad. Not because of hardcoding More
Happy splitting-hanpari 2
So, you see the problem? How can using str.endswith (which is intended for exactly this kind of check) not be clear, and at the same time using c.split(d)[-1]=="" is somehow "clear"? Everybody considers their code clear. That's why this whole category thing is nonsense. More
First-dirk86 1
Sorry, *= max( , 1) is very unclear to me. But this is obviously ridiculous. Everybody considers their own code clear. More
ReFuncPuzzle-nickie
Imitation is the sincerest form of flattery, they say. :-D More
Floatless-htamas
Cool. Mine is also floatless, but in a much more boring way. :-D BTW, all these expr if decimals else 0 are just expr*bool(decimals) More
Second-coells
pi is also in cmath (and has the same value:), no need to import it from math separately. :-) More
First-coells
You don't need outer parentheses in return. :-) Also, al, bl = map(int.bit_length, (a, b)) would probably be nicer (less duplication). More
First-coells
More "functional" than mine. But also uglier IMO. :-] More
First-coells 1
Disappointed! :-P I expected at least you to see that all of these cases are just instances of a general formula. :-] More
First-coells 1
Nice use of next and .find . :-) More
A little weird :)-hrvoje
Please don't use "concatenating digits in a large base" as a method for selecting by multiple keys. Unicode has more than 1e5 code points (if not now, then soon:)). Tuples comparison is exactly meant for this. Key should be (count, -ord). Also, this algorithm has quadratic complexity, while the t More
Recursive, short, weird but works! :)-hrvoje
Nice and complicated. :-P Wouldn't dict be more appropriate data structure for z? More
Look ma, no regex! :)-hrvoje
First, if you _used_ regex here, that would be remarkable. Not using Python re here is like not using a bicycle for swimming. :-D Second, argh. Please don't do if c: return True else: return False if c binds something bool. Do return c Token count just went from 7 to 2. A More
Total n00b-jkibbe 1
Yep, a lot more code than needed. BTW you get a Special Confusion Award for using " ".join on a str. :-D (And then .split() right after that.:) More
Recursion-drejcek 1
Noone said list won't be empty. :-P More
xor-drejcek 1
A lot of people know about .format _method_, but they don't know about format _function_. It's really much nicer when you just want to format a single value. format(m ^ n, "b") More
sorted-drejcek 1
First, don't test "len(args) == 0". Just test "args" (or "not args", if you want to have that order of returns). PEP8: "For sequences, (strings, lists, tuples), use the fact that empty sequences are false." Second, why sort? min and max are linear. More