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
Bitwise XOR and string manipulation-paren8esis 1 1
Hi, `bin()` returns a __`str`__ so `str()` is redundant. 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
Second-zongareight 1 1
This will evaluate everything before it's checked with `any()`. It can be avoided by chaining `or`s. More
First-Leonya 1
Hi, look at _sum()_ and _extended slices_. More
First-vbereznyuk 1 1
Hi, when you first join the phrases, you can replace the words all at once: return ",".join(phrases).replace('right', 'left') More
First-vbereznyuk 1
Hi, as you don't use the index here: for index, value_b in enumerate(sequence[index:]): # you can write: for _, value_b in enumerate(sequence[index:]): More
First-kleshmax 1
Hi, look at _extended slices_ and _sum()_. More
First-vbereznyuk 1 1
Hi, # Instead of this: if len(queue) == 0: continue queue.pop(0) # you could write this: if queue: queue.pop(0) More
First-Rita 1
Hi, `bool` is a subclass of `int`, therefore the nested `if`s are redundant. More
First-kleshmax 1
Hi, 1. look at _filter()_. 2. you could write `x += 1` More
First-kleshmax 1
Hi, 1. look at _filter()_ and _str.join()_. 2. __str__ is immutable in Python, therefore is not the best type for accumulation. More
First-tsumakazu 1
Hi, why not: def checkio(words_set): for x in words_set: if x.endswith(tuple(words_set - {x})): return True return False # or: def checkio(words_set): return any(x.endswith(tuple(words_set - {x})) for x in words_set) More
First-Marpop 1
Hi, instead of `alphabet` you could use `string.ascii_lowercase`. More
First-evoynov 1 1
Hi, _list_ is redundant. You can the set directly. More
First-tsumakazu 1
Hi, all `...if...else...` are redundant, e. g.: if operation == "conjunction": return x and y More
First-Slepice1 1
Hi, 1. There's an unnecessary semicolon :) 2. You could replace lines 5-8 to using all with this: ok = all(state[pipe_num] for pipe_num in pipe_numbers) # then you don't even need the ok variable as you could write this: if all(state[pipe_num] for pipe_num in pipe_numbers): More
First-nastyajeid 1 1
Hi, look _sorted()_ and its `key` parameter. More
First-Pumba_UA 1 1
Hi, 1. Look at _set()_. 2. Line 11 is not Pythonic and you can replace lines 11-13 with: return not my_dict More
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-narumi.kano.3 1
Hi, have at [_calendar.isleap()](https://docs.python.org/3/library/calendar.html?highlight=calendar.isleap#calendar.isleap) and [calendar.day_name](https://docs.python.org/3/library/calendar.html?highlight=calendar.isleap#calendar.day_name). More