40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 4 days
Difficulty Advanced
Best reviews / Newest reviews
First-jirka.hrbek 1
Hi, 1. Line 3: `[]` are redundant. 2. Look at `Counter` in `collections` module. More
First-aisilunya
Hi, 1. _sum()_ is built-in function, don't redefine it. 2. Look at _enumerate()_. 3. Line 13 is useless. 4. Lines 10-12 should be right after the function definition. 5. `sequence` is iterable and _list()_ is redundant. More
First-aisilunya
Hi, ad `a`: You don't need list() as `phrases` is iterable => You don't need that variable at all. ad `b`: x is a __str__ so _str()_ is redundant. And also as `phrases` is __tuple__ of __str__ you can write: b = ",".join(phrases) and `c`: You don't need it. You can chain methods: return More
First-aisilunya
Hi, 1. `== True` is redundant. _str.isupper()_ returns __bool__. 2. `ch` is a __str__ so _str()_ on line is redundant. 3. Look at _generator expressions_ and the _str.join()_ method. More
First-aisilunya
Hi, remove _print()_ function(s) before publishing. It's a good practice. More
First-aisilunya
Hi, look at _extended slices_ and _sum()_ built-in function. More
First-aisilunya
Hi, look at list comprehensions. More
Second-heru
Hi, 1. on lines 5, 8, 11, 20 `[]` are redundant. 2. in fact you don't need those `check_` functions. More
First-Pauls
Man, this is way to complicated... Look at [_sorted()_](https://docs.python.org/3.4/library/functions.html#sorted). More
First-heru
Hi, instead of that `lambda` in `cleanup` you could use _str.isalnum()_ (or a fancier solution: import _filterfalse()_ from itertools). More
First-Pauls
Hi, 1. _sum()_ is a built-in function, do not redefine it. 2. Look at negative indices e. g. `array[-1]` 3. Look at _extended slices_ e. g. `array[::2]` gives you the even elements. More
First-Pauls
Hi, 1. lines 13 to 15 are useless: `return temp` 2. Don't use semicolons in Python. 3. Look at _list comprehensions_ and _generator expressions_. More
First-Pauls
Hi, 1. __str__ is a name of type and also there's a _str()_ built-in function, which you shouldn't redefine. 2. __str__ has _str.isupper()_ method. 3. With _str.join()_ method you can concatenate strings. 4. __str__ is iterable, therefore: for i in text: if i >= 'A' and i <= 'Z': More
First-Pauls
Hi, _min()_ and _max()_ are built-in functions. Do not redefine them: return max(args) - min(args) More
First-Pauls
Hi, 1. `bstr` is redundant. 2. You don't need _str()_ as _bin()_ returns __str__. More
First-GelaGela 1
Hi, for non-empty array: array[-1] == array[len(array)-1] More
First-GelaGela 1 1
Hi, you could write return [i for i in data if data.count(i) > 1] More
For is the best loop :D-JanKaifer
Hi, 1. _any()_ instead of lines 40-43? return any(first in i and second in i for i in groups) 2. `names = net.keys()` 3. `net = {name: {} for rel in new for name in rel}` etc. More
Biiiiiiiiiig if-JanKaifer 1
Hi, why not: return (game_result[0][0]==who and ...) That `if...else` is redundant. More
First-Freezen
Hi, you can write: sum(grid...). `[]` is redundant. More