57
veky
22 48 64 Leader of the month
44584/ 53887
Last seen 22 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-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
Second-martin.beseda.3
About that horrible line 17, I think I have good news for you: tuple comparisons. (a, b) < (c, d) <~~~> a < c or a == c and b < d You can also learn about key argument to min and max. More
First-martin.beseda.3
First, a + a + a is really a*3, even when a is a str. Now you know that, remove the duplication. :-] More
First-martin.beseda.3
You don't need "len(l)". Negative indices are fine. :-) More
First-martin.beseda.3
"lambda i: abs(i)" has a much nicer name. It has three letters. ;-) Google eta-reduction if you want to know more. ;-) More
itertools-gyahun_dash 1
Wow, heavy artillery. :-D Even I didn't know about operator.indexOf. Really cool. :-) More
First-martin.beseda.3
This is not C (nor Perl), you don't need parens after while, if, ... base += -c if isfib(c) else 1 "c = 0 # counter" is a really weird comment. If you want to call it counter, do so. You can even have two names: counter = c = 0. :-D Calling "fib" a function that _checks_ whether somethi More
First-martin.beseda.3
Nice homework: now remove _all_ the duplication from that code above. ;-P And don't write empty except. And why float(...), and int(round..., and all. these. parentheses. ?? More
Fourth-martin.beseda.3
Wasn't it easier to just have one "break" instead of lins 10~12? More
First-martin.beseda.3
When c is of len 1 (as it is here), "c in ['(', '{', '[']" is the same as "c in '({['". Also, that line 7 could really use some dict instead of treating data like the code. "len(l) == 0" is simply "not l". More