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-hanpari 1 1
Nice, but I would shorten _eq_ a bit: eq = lambda w: sorted(filter(str.isalpha, w.lower())) More
First-hanpari 1 1
Hi, why not _filter()_?: "".join(filter(str.isupper, message)) More
Possible to make this shorter? =S-jrebane 1
Hi, look at _sorted()_. With sorted you can omit the _list()_ and the _output.sort()_. In fact you can _output_ completely and "feed_ _"".join()_ with sorted set. More
First-nastyajeid 1 1
Hi, the last `if` is redundant: return len(al) == 26 Instead of lines 4-6 you can use _set comprehension_: al = {x for x in text if x.isalpha()} # or even: return len({x for x in text if x.isalpha()}) == 26 More
First-tsumakazu 1
Hi, `str_number` is __str__, so it's iterable for i in str_number: if i != '0': answer *= int(i) return answer More
First-nastyajeid 1 1
Hi, the last `if` is redundant, you can return the condition directly: return 'boo' in stack More
First-nastyajeid 1 1
Hi, look at _sum()_ and _extended slices_. More
First-nastyajeid 1 1
Hi, you could use `and`, _any()_ and _generator expression_. More
First-nastyajeid 1 1
Hi, you can use _generator expression_ with _sum()_: return sum(x in text.lower() for x in words) More
First-marko_anton 1 1
Hi, 1. __str__ has _str.endswith()_ method. 2. `range(0, len(myList))` == `range(len(myList))` 3. but iterate the __list__ directly is better. 3. Finally: __set__ is iterable therefore you don't even need a list. # You don't need my list # You can't iterate the set directly d More
First-bukebuer 1 2
Hi, it's subjective but it would be nicer to repace lines 11-15 with a generator expression and sum: return sum(cost(t[0]) for t in calldict.values()) More
Simple and clear-texom512 1 1
Hi, why not?: return process(word1) == process(word2) More
First-nastyajeid 1 1
Hi, _str()_ is redundant as _bin()_ returns __str__. More
First-nastyajeid 1 1
Hi, __bool__ is subclass of __int__. You don't need all those nested `if..else`s, e. g.: elif operation == "exclusive: return x != y More
First-nastyajeid 1 1
Hi, you can use `*` operator to unpack `date1` and `date2`, e. g.: d1 = date(*date1) And from datetime import * is not a good practice. More
Clean Binary Count-schanjr 1
Hi, bin() returns __str__, which has _str.count_ method, so you could write: return bin(number).count('1') More
First-marko_anton 1
Hi, you don't need `lambda`. _abs()_ is a function, so: return sorted(numbers_array, key=abs) is enough. More
First-d1skort 1
Hi, 1. the last `if...else` is redundant. You could return your condition after some changes. 2. Those `== False` tests are redundant. More
First-Leonya 1
Hi, look at _sum()_ and _extended slices_. More
Clear First Attempt Using "math.pow"-AaronCritchley 1 1
Hi, you can do it without _math.pow()_. There's a power operator: __**__ (see [this](https://docs.python.org/3/library/stdtypes.html?highlight=binary%20operator#numeric-types-int-float-complex)). More