57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 3 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
The Lantern Festival-vinc 2
Nice and OO, but really too complicated. make_track is all you really need as a separate function, and even it is too verbose. At a first glance I'd say you come from Java, but you know Python idioms very well. Only a few details I find itchy. In Lantern.move, you really could have self.cell = More
one line-michael.kej
set([f for f in blah]) is just set(blah). :-) More
First-michael.kej
Cool. You could have used *args, but this is ok too. More
First-michael.kej
Builtin sum might come handy. And array[len(array)-1] is just array[-1]. More
First-michael.kej
Aaaargh. Too complicated for my poor eyes. :-/ "== True", why? And Lines 10~11, why not just [i]? And why not use a real dict, with setdefault instead of that checking all the time? Or better yet, just use a collections.Counter. Or even better, use builtin max with custom key. ;-P Detail: at the e More
First-UndeadMonkey 1
letter.isupper() is what you're looking for. ;-) Also, don't use Schlemiel the Painter's algorithm without understanding. :-] More
First-LewisFogden
Instead of rebinding words, probably inlining would be better: for word in words.split(): This way it's obvious what you're iterating through. More
One line-LewisFogden
You don't need list. sorted takes a set without problems. And if you use .intersection, you don't need second set. .intersection takes list without problems. Of course, probably better is to use set(...) & set(...). Or better yet, write a function for left and right side at one place. More
zip*-LewisFogden 1
Twice again... what's with that? More
First-LewisFogden 1
len(blah) == 0 ~~~> not blah Instead of '{([' and '})]', it would be better to use pairs,keys() and pairs.values(). That way you have a single source of truth, and don't have to think about modifying code in many places if you add a new pair. More
FIFO stack-NikhilVashisth 1
"if len(stack)!=0" is just "if stack". More
First-EcNeu
Try getting used to // for int division. It will help you when you switch to Python3. ;-) (len(data)-1)/2 ~~~> len(data) // 2 float is unnecessary if you float your 2: just say / 2.0 . More
First-EcNeu
Again, "answer" is completely superfluous. Just return what you want instead of naming it answer. Line 3: if number % 3 == number % 5 == 0: More
First-EcNeu
Aargh. I_will_return = answer now_I_really_should_return_what = I_will_return its_time_to_return = ... Just return it, man. :-D More
Second-EcNeu 1
Don't single-exit your functions forcefully. Instead of naming it "answer", just return it. Also, "is not None" is unnecessary. Matches are always true if anything is matched. "and" is useful protocol, much clearer than nesting ifs. ;-) <= 64 is unneeded. More
First-Taca
You used list() seven times. _None_ of them was necessary. This must be some kind of a record. ;-P bin(n)[2:] is nicer written as format(n, "b"). Padding with zeros is common operation. See str.zfill. (And max is also nice.;) In any case you don't need _three_ cases. Just two. [0]*(a-a)+l is l. More
First-Taca
Argh, too complicated. Have you thought about a nicer data structure than the sequence of strings? :-o And what do you think line 4 is doing? :-/ You don't need () after while. else in line 18 doesn't do what you probably think it does. Line 10: if not route: More
First-Taca
It's nice you learned to use "in", but you can do better. if i.startswith("POP"): ... More
First-Taca
h, m = map(int, time.split(":")) Also, wouldn't it be nicer to name the subexpression abs(long(e?) - short)? More
First-Taca
LOL. You manage to complicate everything. :-) Line 13: just return i, no need to break first. "if fib[0] == i: fib = [sum(fib), i]" is really funny. :-) More