40
suic
16 39 57
9964/ 10664
Last seen 4 days ago
Member for 9 years, 10 months, 19 days
Difficulty Advanced
Best reviews / Newest reviews
First-log2av
Hi, don't use "\\" if it's not necessary. Put your expression in () instead e. g.: grid = ([tuple([0]) * (len(grid[0]) + 2)] + [tuple([0]) + i + tuple([0]) for i in grid] + [tuple([0]) * (len(grid[0]) + 2)]) There are redundant [] on the last line: return sum( More
First-yubitani
Hi, fwx and swx are redundant. f = lambda w: Counter(w.replace(' ','').lower()) return f(first_word) == f(second_word) More
First-todogzm
Hi, extract the pattern from line 4, 5 and make it a function: f = lambda w: collections.Counter(w.replace(' ', '').lower()) return f(first_word) == f(second_word) More
Verify anagrams - First-erik.white.2014
Hi, list()s are redundant. __str__ is iterable. More
First-ankurjuneja
Hi, and now you can remove line 12 and lines 1-3 :) More
First-OlegKulik 1
Hi, _str()_ is redundant. _bin()_ returns __str__. More
My first generator! I love generators!!! =D-ermichin158 1
Hi, good one. It's much more pythonic than your previous solutions. Two comments: 1. You should change the title a bit: "I love comprehensions!!!" :) Generators and comprehensions don't behave in the same way. (check this [blog post](http://python-history.blogspot.co.uk/2010/06/from-list-comprehens More
First-Qandak
Hi, there's an alternative approach. _str.join()_ first and then use _str.replace()_. More
Second-Qandak
Hi, you avoid if...else: return len(args) and max(args) - min(args) More
First-Natali_2_7
Hi, nice one :) Can you make it a one-liner? :) First step is to remove the redundant _result_ variable. More
First-Natali_2_7
Hi, you can use * for unpacking _date1_ and _date2_: return abs(date(*date1) - date(*date2)).days More
First-ZoeyKerr
Hi, the last if and all the == True tests are redundant: return a and b and c and len(data) > 9 def checkio(data): # If the string is not long enough you don't need the whole for loop if len(data) < 10: return False # a, b and c are bool values More
First-diptiranjan
Hi, what does: else: pass do? Nothing. More
First-CoreyVaughan41
Hi, 1. _bin()_ return a __str__, so str() is redundant. 2. __str__ has count method, so the for loop is redundant. More
First-CoreyVaughan41
Hi, 1. Comments makes it hard to read. 2. What's the reason for this assignment: ref_list = string.ascii_lowercase? ascii_lowercase is just a string. 3. __set__ has _set.add()_ method so you don't need to use |=. 4. The last if is redundant: return len(new_set) == len(ref_list) P. S.: Yo More
First-miralin 1
Hi, ','.join() _aka_ str.join() which return __str__ so '%s' % is redundant. More
First-py_code
Hi, you could use the operation names as dictionary keys. More
Absolute Sorting-py_code
Hi, lambda is redundant. _key_ expects a function and _abs()_ is a function, so: return sorted(number_array, key=abs) # is enough More
Number Base-py_code
Hi, don't use _sum_ as a variable name. It's a built-in function. Look at documentation for [_int_](https://docs.python.org/3.4/library/functions.html#int). More
First-py_code
Hi, this is a misuse of _(x)range_. Look at extended slices: array[::2] # even elements More