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-tsumakazu 1 1
Hi, 1. `"".join(text)` is useless, it does nothing. for i in text: # is enough ... 2. Look at _filter()_. More
First-Marpop 1
Hi, 1. Look at [_list comprehensions_](https://docs.python.org/3.5/howto/functional.html?highlight=list%20comprehension#generator-expressions-and-list-comprehensions). 2. Check [_functools.reduce()_](https://docs.python.org/3.5/library/functools.html?highlight=functools.reduce#functools.reduce). More
Right to left-ira.trachuk.1 1
Hi, I have two comments: 1. Don's use _tuple_ as variable name as [tuple is a built-in type](https://docs.python.org/3/library/stdtypes.html?highlight=tuple#tuple). 2. In fact you don't this variable at all as you can chain methods in python like this: return ','.join(phrases).replace("ri More
Another one solution-Baxter 1 1
Hi, what about using slices? # e. g.: summa = sum(array[::2]) More
First-AdamToth 1 1
Hi, on lines 4 - 6 you have three times the same pattern. You could reduce the redundancy by using list comprehension: hasDigit, hasUpper, hasLower = (bool(re.search(rgx)) for rgx in ('\d', '[A-Z]', '[a-z]')) # in fact the has... variables are redundant as you could use all() instead o More
Map & Filter & Reduce fun-arma 1 1
Hi, with operator.mul it's more universal, but you can write it also this way: return reduce(int.__mul__, filter(None, map(int, str(number)))) More
First-StaticFuzz 1 1
Hi, nice solution. You can shorten it: new_list = sorted(list(args)) return new_list[-1] - new_list[0] if new_list else 0 More
First-argrento 1
Hi, good solution. It's more readable then mine :) I have a some suggestions: 1. minX and minY are redundant as range() is zero based based by default: range(minX, maxX) == range(maxX) 2. In lines 15-18: # 1) You don't need nested if's as there's only one condition so you can More
A cool one =)-ermichin158 1 1
Hi, 1. What is creative in this? Checking if a character is uppercase using `ord(symbol) > 64 and ord(symbol) < 91` is quite obvious. 2. You could use _str.isupper()_ for this. 3. Concatenation strings in Python using `+=` is an anti-pattern. More
First-lena-py 1 1
Hi, you could use `*` to unpack values e. g.: first_date = date(*date_1) More
First-freixodachamorra 1
Hi, 1. `type` is a keyword in Python. 2. If you need queue in Python use [deque](https://docs.python.org/3/library/collections.html?highlight=deque#collections.deque) 3. `neighbors` should be split to multiple functions instead of using `type` argument. Regards, suic More
First-HanleyWashington 1
Hi, in fact you don't need to import string here. Look at str.isdigit, str.islower and str.isupper methods. More
yield from-oduvan 1 1
Hi, a "nice misuse" of `collections.Iterable`. There shorter and simpler way to write the same: ```python def flat_list(items): for x in items: if isinstance(x, list): yield from flat_list(x) else: yield x ``` Regards, suic More
ABSsort-grifmang 1
Hi, lines 2-4 are redundant, just remove them. _numbers_array_ is iterable by itself so you don't have to convert it to list. The pattern in lines 2-4 you can usually replace with a list comprehension/generator expression (look at [this](https://docs.python.org/3/howto/functional.html#generator-exp More
First-lena-py 1
Hi, `letters` is redundant. len({char for char in text.lower() if char in string.ascii_letters}) == 26 More
First-mfurones 1
Hi, in python you don't need auxiliary variable to swap values of two variables. E. g. to swap the values of a and b it's enough to do this: a, b = b, a More
user friendly solution-kamitenshi 1 1
Hi, 1. Notice that you do many steps twice. 2. The last if is unnecessary: return liste1 == liste2 More
chain from iterable of ranges-PythonWithPI 1
It's shorter and more readable with a generator expression: ```python return chain.from_iterable(range(l, u+1) for l, u in items) ``` Regards, suic More
quick and dirty :D-for14556 1
This 10. if c == end: 11. found_begin = False could be: 10. if c == end: 11. return tmp_string More
First-alexandrov.net 1
Alternative for 28-29.: `self.stuff.extend(unit() for i in range(amount))` More