57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 22 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-lex.quarkie
Line 10 is more clearly written as "huns = tens = ones = 0". Line 21 is just: "if tens or ones:". And so on. More
First-lex.quarkie
Calculating sorted(data) multiple times is not nice. Cache it somewhere, or just data.sort() at the beginning. BTW that lines 6~7 are weird. How could it be "else"? :-) More
First-lex.quarkie 1
Learn about strided slices. They are useful now and then. ;-) More
First-leighmo83
abs is already a function, lambdifying isn't necessary. ;-) More
First-leighmo83
It seems you're trying to golf. In that case, you can look at my (or nickie's) solution. ;-) More
First-james.verran
You can remove duplication in line 18 with careful slicing of "MDCLXVI", see my solution. Don't use / for int division (line 25), it will bite you when you last expect it. int in line 23 is superfluous for the same reason. But you could do interesting things with zip(str(data).zfill(4), numera More
First-james.verran
You're going overboard with European Association of Fish Pathologists. Generalizing case n=2 is not really productive. And beating someone to death with a loaded uzi is really not fun. :-P Look, your lines 10~17 can be: if "XXX" in candidates: return "X" if "OOO" in candidates: return "O More
class Dude-james.verran
Duuude. :-] Just one nitpick: line 31, please learn about >2-arg form of map. It could come handy. ;-) More
First-Gosha
See collections.Counter. It will help you. ;-) More
First-Gosha
Line 6 can be written as number % 3 == number % 5 == 0. More
First-Gosha
Using not with 2 branches is usually frowned upon. It's better to reverse branches and eliminate not: if array: return sum ... return 0 Even better is to use try. But you're probably too young for that. :-) More
First-Gosha
"if int(digit)" is enough. Or better, to remove duplications of int(...): for digit in map(int, str(number)): if digit: mal *= digit (You can even use filter(None,...) but let's not go there.:) BTW what's "mal" (as a name)? More
First-Gosha
Same as before: if args: return max ... return 0 In new Pythons, you can use default=0 in min and max. More
one-liner-a7295177
Nice "oneliner". :-P But why all those list(...)s? [] are enough. And sum([a,b,a]) is really nicer written as 2*a+b. More
one-liner-a7295177
You can use _and_ for better control flow. ;-) More
Easy-a7295177
What's line 3 for? It was not so hard. :-] More
First-a7295177 1
Why a list?? You never do anything with it except append 1, increment some element (pointless) and return len. More
First-a7295177 1
Aaargh. Don't ever loop over indices when you can loop over values. for char in number: More
Recursion-a7295177 1
You have some really weird ways of thinking. Why outer loop is nice, and inner one is ugly? :-P for i in w: for j in w: More
One-liner-a7295177 1
"a if not b else c" is probably nicer written as "c if b else a". More