31
Cjkjvfnby
10 30 43
5274/ 5695
Andrey Solomatin
Last seen 1 year ago
Member for 11 years, 1 month, 24 days
Difficulty Normal
Best reviews / Newest reviews
First-monkshorin 72 4
Set -1 because **len(array) == 0** PEP8: For sequences, (strings, lists, tuples), use the fact that empty sequences are false. Yes: if not seq: if seq: No: if len(seq) if not len(seq) More
First-mr.floppy 27 1
Some notes about style: no need parenthesis and you miss space after coma return ",".join(phrases).replace("right", "left") More
Nested cycle-mike269 15 3
You can use bool as int. # if x > y: count += 1 count += x > y More
Intersection-bryukh 13 1
No need to **set(second.split(","))**, intersects accept any iterable More
Slice-bryukh 9 1
**el for el in array[::2]** is same as **array[::2]** More
First-JulianNicholls 8
You can use tuple of tuples instead dict **elements = ((1000 : 'M'), ...)** to avoid sort. More
Math-bryukh 7 1
You can sort a,b,c at the begining. This will simplify check and you will not need sort at the end. a, b, c = sorted((a, b, c)) More
for else-veky 7 1
You treat boolean as int, it does not deserves it. :) More
First-xiongbiao 6
http://www.checkio.org/forum/post/1618/proper-way-to-check-if-sequence-is-empty/ you can use str.startswith it is more readable. More
First-makoto_yamagata 4
I down vote this solution because you use **fs += [str(p)]** instead of **fs.append(str(p))**. **bool()** and **** has same behavior in condition expression, you can omit **bool**: **while data and data % p == 0:** **int(''.join(sorted(fs)), 10)** you can omit **, 10** because it More
First-gyahun_dash 4 1
http://www.checkio.org/forum/post/1618/proper-way-to-check-if-sequence-is-empty/ More
Double loop-bryukh 3 1
For one side it is clear and readable but for other is so uneducative for it algorithmic complexity. You can use combinations from itertools to make all possible pairs. More
switch-case-bryukh 3
Using dict as switch is too complicated for current task. More
Tricky-DanielDou 3
It can be more cute and clever with string format: return eval('%c%c%c(%s)' % (115, 117, 109, x)) More
ord-gyahun_dash 3 1
string formatting will make it more readable '%c%c'. you can use set methods to find intersection. More
First-freezoo 3 1
At line 5 you code works correct, but you implement you idea with error. Real name for variable **line** should be **char**. You don't need **list(s)** in that code, just pass **s**. return list(map(lambda s: "".join(list(s)), zip(*grid))) line 30 and 45: you no need parenthesis arou More
re-magdre 3 1
Why not **re.sub(r'[^A-Z]', '', text)**? More
First-kzfm 3
You don't need **r** variable, you can return instead. More
AngelRaposo-AngelRaposo 2 1
Check docs about string formatting. text = ' ' + text + ' ' comment = " " + "_" * len(text) + "\n" comment += "<" + text + ">\n" comment += " " + "-" * len(text) return "\n" + comment + COW Using string formatting: width = len(text) + 2 More
iter-Sim0000 2 1
You can move common code from max and min to separate function. More
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15