13
Winandfx
2 10 28
772/ 845
Andrey Makarov
Last seen 2 years ago
Member for 9 years, 4 months, 23 days
Difficulty Normal
One-liners are WET!

Best reviews / Newest reviews
Set comprehension-veky 1
wow, that's short. I took a long way of matrix rotation (as i understand it) to get diagonals https://pp.vk.me/c623930/v623930561/18ff7/wPgt0vP4oWY.jpg More
First-ForrestGump 1
`"exclusive"` can be implemented simpler: `int(x!=y)` http://stackoverflow.com/a/433161/1119602 P.S. built-in `operator` module has all needed operations except for implication More
Factored-veky 1 1
completely forgot about zip functionality and....) map(lambda *a: a, *matrix) More
slice forward-blabaster
oh. I always thought that fors in list comprehension run vice versa.) How did i manage to write any program??) Very tricky solution, imho More
named group-gyahun_dash 1
Under Win7: > unknown specifier: ?P. It's ok? And what's a group 'whole'? I don't see its definition More
First-skull3r7
I like `sum(array[::2])`, me myself used `enumerate` What about using `array[-1]` to get the last element?) More
Filter it! Join it!-Winandfx
ok. i should have used str.isupper More
meh-Krischtopp 1
Booleans can be *sum*med as *int*s More
First-Bob_Lavey
It's mentioned in task that input is a `sequence of strings as a tuple`. Ur solution solves a broader task.)) More
First-Kyros
u can iterate directly through items (at least in the inner loop) `for sequence_j in sequence[i+1:]:` Outer loop would need `enumerate` in that case More
First-SpyR1014 1
wow, nice replacement for nested loop More
First-yoichi
like your set-based approach.) i think it's a little faster to just check whether `set` is empty: `not set(string.ascii_lowercase)-set(text.lower())` More
First-serg5978
`date1` and `date2` contain `datetime.date` arguments in the right order so you could use an asterisk to ask Python to "unpack" them: `d1 = datetime.date(*date1)` https://docs.python.org/3.4/reference/expressions.html#calls More
First-oliwiam96
you could use `count+=number&1` instead of `if number%2:`. one-liner:) `sum((n>>i)&1 for i in range(math.floor(math.log(n, 2)+1))) if n else 0` More
First-Eugene23
inner loop is not needed. You could use `if r1 in y:` instead. Or better use sets `set(x)&set(y)` More
First-Regius 1
`if x in y:` is a good way to avoid inner loop. Using `set(a)&set(b)` can help to avoid outer loop too.)) More
Skew-symmetric Matrix-roman.kachanovsky 1
i == j and not m[i][j] is it a check for zero on diagonal? The condition m[i][j] == -m[j][i] already checks this. Also for i in xrange(len(m)) for j in xrange(len(m)) makes double checks of the same cells More
First-kv.polyanskiy
Why do you need to check `if len(item) == 2:`? More
Expand area to the left&right /13 lines-Winandfx
slicing would make this solution better.) More
First-ikami
You don't need to pass anything to magic.) More
1
2