57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 14 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
OOP plague-quarkov 2 1
Obligatory Youtube link: https://www.youtube.com/watch?v=o9pEzgHorH0 :-) More
TheMostNumbers_so easy now?-GiForce 2 1
It could be even easier. You should usually put normal cases first, exceptional ones later. max(args) - min(args) if args else 0 Or, you can exceptionalize inwards: max(args, default=0) - min(args, default=0) :) More
Functional generator-nickie 2
chain(*map(f, l)) is what you're probably looking for. ;-) (And it has nothing to do with ChainMap.:) More
Smart lambda solution-gcolle 2
Instead of int(blah/2) you can use blah//2 (or even blah>>1). And you don't need ==1 on len(x)%2. BTW nice smuggling of x.sort() across the lambda. ;-) More
Pointless?-veky 2 1
At first sight, this is usual high-order functional stuff. But there are a few puzzling details, in the form of code that should do nothing, but without it, the solution doesn't work. :-] * Why is that "if (push, pop, peek)" there? 3-tuple should always be true, right? * Why is that "and (yiel More
First-freixodachamorra 2 1
Why not simply "return l == list"? Lists are equal, not only their lengths. More
map(chr)-curious_k 2 1
You could have written `range(ord("a"), ord("z")+1)` for maintainability. :-D More
First-BestSteve 2
Best reinventing the wheel ever. :-P More
First-suic 2 1
Nice usage of time module. conv_dict could be much less repetitive if you looked up things like this: m = int(mv) * conv_dict[mm.rstrip("s")] (New TransformDict might help you in Py3.5, if it makes it there.;) And of course, that code repeated twice should be factored out as a function, just More
Like pulling teeth-gileadslostson 2 2
You're aware that you wrote the same thing three times? :-) More
First-lsdda 2 1
That counting from 1 at every step feels forced a bit. Python naturally counts from 0. For "a in bla1 and b in bla2 and c in bla3"... you might wish to learn about sets. Precisely, sets of tuples. In your inner functions, you don't need lines like 25 and 26. Python returns None by default, whi More
Shortest? 52 - Kill me now-StefanPochmann 2 2
https://www.youtube.com/watch?v=sn4BqpI1p6E :-D More
Oneliner-gflegar 2 1
I like it too. :-) Of course, it can be refactored (to remove repetition) as sum(((t-f).days+(f.weekday()+i)%7+1)//7for i in(0,1)) :-] More
First-gflegar 2
Nice recursion. :-) sorted. Lose the brackets. You know the drill. ;-) In fact, I think this would be a good place to teach you about enumerate. for index in range(len(sequence)): do something with index and sequence[index] is pythonically written as for index, elemen More
yield-oduvan 2 1
> Output: The list of integers. Yeah, right. :-P BTW, I'm quite sure I tried a generator anyway (a long time ago), and it didn't work. Did you change something? More
shmur-tatertotsis 2 1
Nice. If it had a space after the comma in line 1, it would be perfect. :-P More
Strange roman math-LukeSolo 2 1
Ok, this puzzled even me. Not in what it does, but how did you think of this. :-D More
First-Fedorovich 2 1
This is a nice example of how chaining can help you write better code. First, x == 1 and y == 1 can be written as x == y == 1. Then you see you have it also in equivalence. if x == y == 1 or x == y == 0: Then you see you can factor out x == y. if x == y in (0, 1): Then you realize that More
Yield!-LukeSolo 2 1
LOL. I'm beginning to like you. You have some potential. ;-) (Of course, you're aware of bin builtin? Just checking...) More
completely_empty = lambda *args: globals()['completely_empty'](*args) .....-flpo 2
Next time someone tells me Python is a functional programming language, I'll show them this. :-DD More