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-Djekke 1
Hi, you could use _timedelta.days_ instead of _date.toordinal()_: (date(*date1) - date(*date2)).days More
First-Djekke 1
Hi, when you _str.join()_ first and then _str.replace()_ after, you can do the replacement in one step. More
First-nastyajeid 1
Hi, 1. instead of `x.isalpha() and x == x.upper()` you can use `x.isupper()`. 2. instead of concatenating __str__ with `+` you can use _str.join()_. return "".join(x for x in text if x.isupper()) More
First-nastyajeid 1
Hi, in fact you don't need `w` as `[]` because it is enough the count the words: w = 0 words = words.split() for x in words: if x.isalpha(): w += 1 if w == 3: return True else: w = 0 return False More
First-mw.a
Hi, look at _any()_, _all()_, _str.isupper()_, _str.islower()_, _str.isdigit()_. More
First-Pumba_UA
Hi, 1. `array` is iterable. 2. Look at _extended slices_ and _sum()_. More
First-Pumba_UA
Hi, 1. What's wrong with `len(args)`? 2. Why not: return len(args) < 2 3. Line 5: You don't need `*`. More
First-Pumba_UA
Hi, look at _str.join()_ and _str.replace()_. More
First-Pumba_UA
Hi, you can use `*` to unpack `date1` and `date2` e. g.: d1 = datetime.date(*date1) More
First-kasuka
Hi, 1. `lambda` is redundant. 2. _list()_ is redundant as _str_ is iterable. You could write: return "".join(filter(str.isupper, text)) More
First-arnogils
Hi, you could use _ascii_lowercase_ from _string_ module. More
House password-arnogils
Hi, 1. You don't `if...else`. You can directly return the condition. 2. Look at _all()_ and _generator expressions_. 3. An alternative to _re_ is to use _str.islower()_, _str.isupper()_, _str.isdigit()_/ More
First-arnogils
Hi, you don't need `new_list` variable, you could return list comprehension directly. More
First-arnogils
Hi, 1. Line 2: `if not array:` 2. Look at extended slices, e. g. `array[::2]`. More
First-LeFree
Hi, look at _any()_ and _all()_, e. g.: return all(chr(ch) in text for ch in range(97,123)) More
First-LeFree
Hi, 1. Look at _sorted()_. 2. Look at _max(). More
First-LeFree
Hi, 1. It is not necessary to parenthesize `if` conditions. 2. You don't need `number` variable: for i in str(number): 3. Look at _reduce()_ in _functools_ module. More
First-LeFree
Hi, using _sorted()_ instead of _list.sort()_ will shorten it to one line. More
First-LeFree
Hi, 1. _sum()_ is a built-in function, do not redefine it. 2. You could write: for i in range(len(grid)): for j in range(len(grid[0]): 3. You could use _abs()_ instead of _fabs()_. That way you could omit `import math`. I've played with your code, result is [here](http://www.checkio More
First-LeFree 1
Hi, 1. Line 2: Why not `",".join()`? 2. Line 3: You could write: `text[:-1]` More