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-tehtactics19
Hi, `len(array)` is redundant. More
First-tehtactics19
Hi, `if x == '0': continue` is redundant. Why not: if not x == '0': count *= int(x) More
First-tehtactics19
Hi, [] are redundant. Look at _filter()_ built-in function. More
First-tehtactics19
Hi, without `string` it would be nicer. More
First-joelhoward0
Hi, this is "obfuscative". Why not: return [d for d in data if data.count(d) > 1] # ? More
First-daswerth
Hi, instead of lines 14-17 you could write: return brackets == [] # or return not brackets More
First-daswerth
You like typing :) import re VOWELS = "[AEIOUY]" CONSONANTS = "[BCDFGHJKLMNPQRSTVWXZ]" r = re.compile(r'\A({0}?({1}{0})*{1}?){2}\Z'.format(VOWELS, CONSONANTS, '{1}'), re.I) def checkio(text): return sum(bool(len(w) > 1 and r.match(w)) for w in re.split(r' More
First-AndreyDorofeyev 1
Hi, 1. You can import string.ascii_lowercase instead of `abc`. 2. `... if ... else ...` is redundant. return all(w.lower() in text.lower() for w in abc) More
Second-AndreyDorofeyev
Hi, all the `... if ... else ...`s are redundant. More
First-alexbadaloff
Hi, 1. Default value for lst is useless. 2. You could omit parentheses around lst.count(x)>1 and out_list. More
First-GennadiyL
Hi, 1. print(result) is unnecessary as it's never reached. 2. you could use i += 1 instead of i = i + 1. More
First-HanleyWashington 1
Hi, non_unique_data is unnecessary you could directly return the list comprehension. More
First-suzuki.mogu 1
Hi, this is all but not pythonic. 1. List is iterable. You don't need to use indexes to access elements. 2. Look at [enumerate](https://docs.python.org/3/library/functions.html#enumerate): def checkio(data): answer = [] for i, vi in enumerate(data): for j, vj i More
Second-ira.trachuk.1 1
Hi, len(text) == 26 is a boolean so you can return it directly without if: return len(text) == 26 More
First-tofol 1
Hi, I agree with previous comment, but you can also significantly shorten you existing code e. g.: # assign game_result to a shorter variable gr = game_result # remove all the _row, _column, _diag variables as you don't need them (see below), # replace game_result with gr and crea More
1 line-texom512 1
Hi, "crystal clear" but creative :) 1. `map(lambda x:...)` is not good practice. 2. Alternative way to compute signum: `def signum(x): return (x > 0) - (x < 0)` More
oneliner-AlexanderPavlichuk
Hi, _str()_ is redundant. _bin()_ return __str__. More
Very Clear-texom512 2
Hi, this is not pythonic: 1. `from math import *` ugh!!! Import everything from `math` for a function which you don't need... is the reason for thumbs down. 2. Look at `//`. 3. `if not data:` instead of `if len(data) == 0:` 4 `else` branch on lines 11-17 is redundant: def checkio(data): More
100% Clear-texom512 2
Hi, you have weird sense of clear. This solution is not pythonic, e. g.: 1. Import `string` is redundant. 2. __str__ has _str.islower()_, _str.isupper()_ and _str.isdigit()_ methods. etc. More
Slow and Heavily Described.-BirrellWalsh
Hi, look at [__collections.Counter__](https://docs.python.org/3.5/library/collections.html?highlight=counter#collections.Counter). More