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-DarkhanShakhanov
Hi, you can use __frozenset__. return ','.join(sorted(frozenset(a.split(',')) & frozenset(b.split(',')))) Edit: Or even __set__: return ','.join(sorted(set(a.split(',')) & set(b.split(',')))) More
First-spoty
Hi, a bit shorter: return sum((x[0]-1, x[1]-1) in b or (x[0]+1, x[1]-1) in b for x in b) More
Most numbers-juancruz.acosta2
Hi, a lot of redundant variables. In fact you don't need `ma`, `mi` and `dif`. More
First-PsnDth
Hi `args` is iterable, so list() is redundant. You can write: if not l: return 0 More
Bcount-juancruz.acosta2 1
Hi, you can remove number 3 and 5. `n` is redundant: return number.count('1') More
First-DarkhanShakhanov
Hi, you don't need `a`: return "".join(result) More
First-HarryV
Hi, Look at 1. extended slices e. g. `array[::2]` 2. negative slices e. g. `array[-1]` 3. _sum()_ built-in function. More
First-johanna1109
Hi, 1. Line 3 is redundant. 2. You can nest method calls: return ','.join(phrases).replace('right', 'left') More
First-HarryV
Hi, you can use _sum()_ with _generator expression_. More
First-johanna1109
Hi, 1. Line 17 is redundant. 2. Instead of lines 13-17 you could write: `return c == 3` More
First-Narsiba 1
Hi, for non-empty list: `array[-1] == array[len(array)-1]`. More
Easy to understand :)-AsEsm
Hi, 1. `round(float())`s are redundant. 2. You can handle the `len(args) == 0` case with `try..except` but there are more elegant ways. More
First-tofguerrier
Hi. A small note: Using dictionary instead of if .. elif .. else could save you some typing. More
First-sajnin
You can you x ** 0.5 instead of sqrt(x). More
Second (using map)-Ceph3 1
It's short and clear. Consider to move to Clear section. More
What's wrong?-suic
This solution is for demonstration purposes ([see](https://py.checkio.org/forum/post/10113/help-please/)). More
First-mihrarty
Hi, 1. Instead of lines 10-14 you can write: `return sum(x[0]!=x[1] for x in zip(*(map(int, i) for i in (x, y))))`. 2. Look at `^` (alias `xor`) operator. Regards, Gabriel More
First-Sabina 1
Hi, 1. _issufix()_ is redundant see [_str.endswith()_](https://docs.python.org/3.5/library/stdtypes.html?highlight=str.endswith#str.endswith) 2. `is not` and `!=` don't do the same thing (look at [this](https://docs.python.org/3.5/library/stdtypes.html#comparisons)) 3. Instead of: if word1 is More
First-Sabina 1
Hi, 1. look at the _sum()_ builtin: sum(int(digit) for digit in xnorm) 2. In fact, you just need to count the number of "1" in xnorm, therefore: return bin(n^m).count('1') More