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-Legat
Hi, in fact _checkio()_ is equals to _sum()_, so you could write: checkio = sum More
First-Dima_Tkachuk
Hi, 1. This is an anti-pattern: if condition: return False else: return True # You could write: return not contdition 2. `True == 1` and `False == 0` so: return not((not upp) or (not low) or (not dig)) # or shorter: return upp and low and dig More
First-marko_anton
Hi, I have a few comments: 1. _bin()_ returns __str__ so _str()_ is redundant. 2. Look at `^` operator or _set.symmetric_difference()_ method ([docs](https://docs.python.org/3/library/stdtypes.html#set.symmetric_difference)). 3. `range(20) == range(0, 20)` 4. Line 12: `hem_dis += 1` 5. You could us More
First-jakow
Hi, 1. _sum()_ is a built-in function, don't redefine it, e. g. `sum(array[::2])`. 2. What's the point of `[0:]` `table = array[0:][::2]`? `array[::2]` is enough. 3. For non-empty array: `array[len(array)-1] == array[-1]`. ​ More
First-Cicciobellodrindrin
Hi, 1. Look at _filter()_ and _str.join()_. 2. As __str__ is an immutable type in Python, it's not the best candidate to accumulate values. 3. You could write `i += 1`. More
First-Cicciobellodrindrin
Hi, this: if text.lower().find(s.lower()) != -1: is not Pythonic. It's more like _Javascript_ than Python. It should be: if s.lower() in text.lower(): More
First-Ganj1k
Hi, look at _sum()_ and _extended slices_. sum(array[::2]) # sum of even elements More
First-Ganj1k
Hi, 1. _list()_ is redundant as _sum()_ accepts _generator expressions_. 2. _int()_ is redundant as __bool__ is just a subclass of __int__. return sum(word.lower() in text.lower() for word in words) More
First-Ganj1k
Hi, 1. _list()_ is redundant. 2. Look at _filter()_. 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
First-Marpop
Hi, 1. _str.isupper()_ returns a __bool__ therefore `== True` is redundant. 2. __str__ is immutable, therefore it's not a good type for accumulating values. 3. Look at [_filter()_](https://docs.python.org/3.5/library/functions.html?highlight=filter#filter) built-in function and the [_str.join()_](h More
First-abhi.iitdmnc
Hi, line 6 is useless as it's never reached. More
First-ahmedengu
Hi, using indexes is useless here. Text is __str__ which is iterable, therefore you can write: for i in text: if i.issupper(): # Don't forget the parens :) x += i IMO list comprehension + "".join() would be more suitable here. More
First-Marpop
Hi, look at: 1. [_extended slices_](https://docs.python.org/3.5/whatsnew/2.3.html?highlight=extended%20slices#extended-slices) and 2. the [_sum()_](https://docs.python.org/3.5/library/functions.html?highlight=sum#sum) built-in function. More
First-Marpop 1
Hi, `f` and `s` are redundant. More
sum(data)-Alexona
Hi, you can shorted this even more. _checkio()_ in fact equals to _sum()_ so: checkio = sum # is enough :) More
First-Marpop 1
Hi, `lambda` is redundant. `key=abs` is enough. More
First-Marpop 1
Hi, `return` is a statement _not_ a function. Parentheses on lines 11, 13, 15, 17 are redundant. More
First-pbeesley 1
Hi, 1. You could write alphabet as a string: "abcdefghijklmnoprstuvwxyz" as __str__ is is iterable. 2. The if is redundant as: if condition: return True else: return False # is the same as return condition More
First-MichaelAzar
Hi, I have a few comments: 1. Line 2-4 for are useless. On line 8 you use x.isalpha() which returns False for white spaces, so you don't need to remove them previously. All you need to preserve is this: text = text.lower() # and then replace no_white with text for x in text: More