57
veky
22 48 64 Leader of the month
44583/ 53887
Last seen 14 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
Dynamic-veky
Thanks Pytato for the idea. ;-) More
First-sodium
Lines 12-14 can be simply written as f = kwargs.get('key', lambda x: x) Also, None can be aliased. :-) val = fval = None More
First-MatthiasWiesmann
"return None" is the same as "don't return anything". You don't need lines 5 and 12. More
First-Mycroft0121
aargh. My eyes hurt. What good can you _possibly_ think will come out of a line as if b != int and b != str and b != list and b != float and b !=bool: And lines 5-11 are really mind-bending. Is this some kind of bet? How to convert iterable to list in the most complicated way imaginabl More
Mycroft's-Mycroft0121
Lines 2-4: you can set a = b = c = 0 And in line 15, you can just say return a and b and c and len(data) >= 10 More
First-Mycroft0121
base is not necessarily named parameter. :-) More
First-Mycroft0121
c.extend([x]) is much clearer as c.append(x). And whole business is just a list comprehension, but you don't need to know about that yet. :-) More
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
First-Mycroft0121
You see what happens when you don't exploit patterns? Your code explodes. :-P More
First-timur.hamzin
This is so redundant it hurts. :-) More
First-blabaster
Argh. Those explicit slices are really unpythonic. Please use split. Also, see dict.setdefault. ;-) More
Explicit formula-Juge_Ti
int(a/b) is a//b. Also, you don't have to round the result: "four digits precision" here means "(at least) four correct digits", which you can see from "±0.0001". More
First-lsdda
You could append fresh [] to result between lines 4 and 5. (Then it would be obvious that it's just a list comprehension.:) But this way is also ok. range(0,bla) is just range(bla). loop in line 5 can be more pythonic: for row in data: result[i].append(row[i]) More