40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 4 days
Difficulty Advanced
Best reviews / Newest reviews
joinreplace43-flex 1 1
Hi, one small thing: The parentheses around ",".join(phrases) are superfluous as you can chain methods in python. More
First-gmixo 1 1
Hi, you can shorten the last line like this: return all(f.findall(data) for f in (r1, r2, r3, r4)) or you can go even further: # Lines 4-7 contains the same pattern rx = re.compile(regex) # You can extract the pattern and make a list comprehension or generator expression r1, r2, More
extend/isinstance-Tarty 1
I like your style. Your solutions are concise and clear. (I don't have to "be a parser" to read them :)) More
No idea-kompas
Hi, 1. != None is unnecessary. 2. There's three times the same pattern. Consider using _all_ and _list comprehension_ or _generator expression_ instead. More
Safe-kompas
Hi, 1. Line 2: _if else_ is unnecessary, and in python you could write it like this: return (0 <= row < height) and (0 <= col < width) and grid[row][col] 2. Line 10: a) _if ... else_ is unnecessary b) _x != 0 or y != 0_ is the same as _x or y_. So you could write this: sum += More
one line-ZoltanOnody 1
Hi, two things: 1. __list__ is redundant as numbers_array is iterable. 2. in this case you can replace lambda x: abs(x) with abs More
one line -ZoltanOnody 1
Hi, if you want to make "one-line-one-liners" use lambda :) More
accumulator, for loop, if statement bootlean-jakobEatsCake 1
Hi _chr.isupper()_ returns a boolean value so == True is redundant. More
First-thunderph0enix
See my comment on your Second solution. Btw. I like this more than that one. Checking if index is valid by throwing exception (as you have it there) is not a good approach. More
Second-thunderph0enix
Hi, import _math.pow_ is redundant. There is a built-in operator for power: __**__. More
First-thunderph0enix
Hi, look at slicing and indexing and in Python: 1. array[len(array)-1] == array[-1] 2. array[::2] does the same as your lines 9-11 Last thing: sum is not a good variable name as there's a built-in function called __sum__. More
First-studioj
Hi even it's marked as Creative: To my mind __is not__ is not (:)) the correct comparison here. It should be !=. More
noob way to solve. but whatevs. Still learning-jakobEatsCake
Hi, powernumber is redundant, you could write: return array[n] ** n More
First-mlucas457
Hi, why not?: return temp More
First-mlucas457
Hi, __str__ is iterable therefore list() is unnecessary. More
First-spoty 1 1
Hi, 3 little things: # connection = (connection, ) is redundant self.connections += (connection, ) # lambda in line 23 is redundant: return reduce(set.union, self.connections) # change self.connection to list as self.connection is mutable e. g.: self.connections More
Rock-rockneurotiko
Hi, you could omit the if in lambda: # 1. using filter() # 2. or use True == 0 and 0 * string = "": x * x.isupper() More
First-pedja
Hi, in this case: lambda l: l.isupper() # is the same as: unicode.isupper # without ()! More
First-johnjohn
Hi, two things: 1. Why text[::], why not just text? 2. lambda is redundant: lambda x: x.isupper() # is the same as str.isupper # without ()! More
One-liner generator-VirtualTam
Hi, a few things: 1. string is iterable therefore list() is redundant. 2. check str.isupper 3. in python you can write: 'A' <= letter <= 'Z' More