57
veky
22 48 64 Leader of the month
44584/ 53887
Last seen 20 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-Mycroft0121
First, why a special case that is not special at all (lines 2-4)?? Second, why are you str-ifying i and j? More
First-Mycroft0121
Nice solution, but "i" is really a strange name for a product. :-) More
First-Mycroft0121
sequences are boolable. You can just write "if not args" in line 2 (or even "if args" if you switch lines 3 and 5). More
First-Mycroft0121
That "sum" being red wasn't enough of a hint for you? :-) Yes, there is a sum builtin. It might come handy. ;-) Also, you might learn about slices and negative indices. More
First-Mycroft0121
See a pattern? :-) BTW, that "else" is really misplaced. ;-P More
First-Mycroft0121
6 times... have you considered writing a function? :-] More
First-Mycroft0121
Again, you might see (and exploit) a pattern in the above code. At least in lines 10-17. :-) More
First-Mycroft0121
What did you think "key=int" was doing?? And why changing data[0]?? 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-smilicic
I guess now you see why I strive to write Artifex completely in English. That language mix (nw_bio:) is really jarring. :-] dict with bool values that are by default False, is really just a set. But it's nice you showed you knew about .fromkeys. ;-D About that ugly "if it is there, append, els More
First-smilicic
Keyword arguments don't _have_ to be lumped together with **. "def min(*args, key=lambda x:x, **kw):" would free you of writing line 2 (and 18). And you don't really need rest of **kw anyway. Lines 4~7 could be replaced with: if len(args) == 1: args = list(args[0]) and then jus More
Tail-smilicic
* You should write m == n == 0 here. * int is completely superfluous here. bool is a subclass of int. * n%2 != m%2 (parentheses not needed!) is easier written as (m - n)%2 (m is not congruent to n mod 2). * You might want to learn about ^ operator. ;-) * This is not tail recursion either More
First-smilicic
"for i, j, (di, dj)". Unpack what you need. BTW dirs is really a set, order is obviously not important. Do you _really_ consider product easier than nested loops? (for i,j,d. For coords, you can just use "ti not in rr or tj not in rc") Of course, you don't really use nr and nc: things like rr=ran More
Readable-smilicic
You bet it's readable. After you read it twice, it better be. :-D More
First-smilicic
You don't really need line 7. If data is less than ar, then N is 0, so you ''.join the empty list, and out stays the same. Here it doesn't matter since len(romans) is small, but a rule of thumb: *don't* use Schlemiel the Painter's algorithm for joining strings. Better leave the lists in place (se More
First-smilicic
Read the hints. ;-) return out.strip() is much easier than all those conditional adding of spaces. Also, a list that is ' '.joined at the end might be a better choice. Lines 25~28 are just out += (FIRST\_TEN + SECOND\_TEN)[number], right? :-) Also, "if number//100>0" normal people usually writ More
First-smilicic
Nice refactoring, but you could do better. For example: if game[i][j] == letter: cols[i] += 1 rows[j] += 1 Then you see you're only accessing game[i] as the first index, and loop in line 5 should really be for i, row in enumerate(game): "something.count(3) > 0" More
First-martin.beseda.3
Duplication hurts my eyes. :-O More
First-smilicic
You don't need N, you need range(N) (6 times). So name _that_: R = range(len(matrix)) I'd even say what you need is a set(range(len(matrix))), since you don't really care about order, and you do containment checking often. list of lists of bools is really too "boxy", especially when it' More
First-smilicic
Nice approach, but really too complicated. There is a much easier general approach, but if you wanted to be original, you did it. :-) [And BTW, really nice use of divmod.:] nprim is really a Counter. But here it doesn't matter much. That "initialization" in line 9 shows you still find it hard More