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-spoty
Hi, a bit shorter: return ''.join(filter(str.isupper, m)) # :) More
Second-spoty
Hi, I've played... the result is [here](http://www.checkio.org/mission/end-of-other/publications/suic/python-3/spotys-shortened/). More
MySolution-RohitKulkarni
Hi, you don't need the last if: return second in friends[first] # is enough More
First-andrqxa12
Hi, I have some comments 1. _bin()_ returns __str__ so _str()_ is redundant. 2. Look at the _str.count()_ method. More
Solution for "Binary count"-Dronimo 1
Hi, _bin()_ returns __str__ so _str()_ is redundant. More
First-BevenNyamande
Hi, d is redundant: return [num for num in data if data.count(num) > 1] More
First-BevenNyamande
Hi, you don't need the tuple: more, less = max(args), min(args) # and in fact you don't need more and less return max(args) - min(args) More
Second - lambda + reduce-dubkc
Hi, in this case you don't need lambda. You can import mul from operator or basically use int.\_\_mul\_\_: return reduce(int.__mul__, [int(x) for x in str(number) if x!= '0']) # another approach: return reduce(int.__mul__, filter(None, map(int, str(number)))) More
bin int done it-CaptCalculator
Hi, 1. you don't need `[]` as _sum()_ accepts generator expressions. 2. you don't need _list()_ as _bin()_ returns __str__, which is iterable. 3. instead of _int()_, you could simply `sum(i == "1" ...)`. 4. in fact you don't need _sum()_ at all. Upon closer inspection, that `sum()` from no. 3. is s More
op_dict-CaptCalculator 1
Hi, __bool__ is subtype of __int__, so you don't need those nested ifs and inner functions. For example: def equivalence(x, y): return x == y # or: equivalence = lambda x, y: x == y More
First - sorted + lambda-dubkc
Hi, 1. Lambda is redundant. key expects a function and _abs_ is a function so: 2. List comprehension is redundant. Tuple is iterable. sorted(number_array, key=abs) # That's it :) More
First - tokenize string and sort-dubkc
Hi, 1. common = list() is redundant, on the line 8 you reassign the common. 2. You can use _sorted()_ instead of sort. def checkio(first, second): firstTkn = first.split(',') secondTkn = second.split(',') return ",".join(sorted(word for word in firstTkn if word in More
First-tondajehlar 1
Hi, I have a few comments: 1. No offense: biggest, smallest, ... cislo(?) Why not number? 2. Look at _min()_ and _max()_ function in Python. ([Built-in functions](https://docs.python.org/3.4/library/functions.html)) More
First-tondajehlar
Hi, 1. instead of _in cisla_ you can use _str.isnumeric()_ or _str.isdigit()_. (See [this](https://docs.python.org/3.4/library/stdtypes.html#text-sequence-type-str)) 2. _jeSlovo_ is a predicate, so you can/should use True/False instead of 1/0. 3. Line 12 you can write this way: pocetSlov += 1 More
First-tondajehlar
Hi, I have two comments: 1. Don't use _sum_ as variable name. _sum()_ is a useful built-in function. 2. Look at negative and extended slices in Python: # For non-empty array: array[::2] # even indexes sum(array[::2]) # sum of even in More
First-tondajehlar
Hi, you don't need parentheses in conditions. More
First-tondajehlar
Hi, you can use _*_ to unpack date1 and date2. More
First-tondajehlar
Hi, you don't need re.sub. There's _str.replace()_ method. More
First-tondajehlar
Hi, using _str.join()_ with generator expression or _filter()_ would be more efficient. Consider the fact that in python __str__ is immutable. More
Digits Multiplication-eB_s3000
Hi, why not?: if n: count *= int(n) More