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-yellow_man
And she's buying a stairway to m3 ... oops.. heaven More
Third-Wienands
Hi, you could use _sum()_: return sum(chr(ord(pawn[0])-1)+str(int(pawn[1])-1) in pawns or chr(ord(pawn[0])+1)+str(int(pawn[1])-1) in pawns for pawn in pawns) More
Normally Solved-Golli19
Hi, this is an anti-pattern: if (x == 1 and y == 0) or (x == 0 and y == 1): return True else: return False # is equivalent to: return (x == 1 and y == 0) or (x == 0 and y == 1) More
First-evdel
Hi, you can use `*` to unpack `date1` and `date2`: f = datetime.date(*date1) More
First [one liner]-splinter12345
Hi, 1. I see 4 lines ([one-linerized :)](http://www.checkio.org/mission/unlucky-days/publications/suic/python-3/one-liner/)) 2. `calendar` isn't used. 3. You could write: `sum(cond for i in range(1, 13))` instead of `sum(1 for i in range(1, 13) if cond)` More
First-Limanskida.
Hi, 1. Use `and` not `&`. 2. You can use _all()_ instead of chaining _and()_. More
Monkey Typing-RafaelSPinto 1
Hi, look at _sum()_: return sum(word in text for word in words) More
Days Between-RafaelSPinto 1
Hi, you can use `*` to unpack `date1` and `date2`. More
Right to Left-RafaelSPinto 1
Hi, what about: return ','.join(phrases).replace('right', 'left') # instead of lines 2-4? More
First-hiya-m 1
Hi, lambda is redundant: return filter(str.isupper, text) More
First-solgrey
Hi, that `n + 1` is redundant. You could write: if len(array) > n: return array[n] ** n else: return -1 # or even: if len(array) > n: return array[n] ** n return -1 More
First-rrsony22
Hi, 1. That `if...elif...elif` is redundant. Those are not special cases. The only special case is _empty list_. 2. Don't use semicolons in Python. 3. Those `B-E` variables are redundant. Why not?: return sum(array[::2]) * array[-1] More
invasive-AndreyDanin
Hi, _counts_ is redundant: return [i for i in data if data.count(i) > 1] More
golf-minto
Great job! Much nicer than mine :) More
First-nls
Hi, last if is redundant: return re.match("(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*[0-9].*)", data) is None # or even: return len(data) >= 10 and re.match("(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*[0-9].*)", data) is None More
List Comprehension Practice-jaburaschi 1
Hi, [] and `...if...else` are redundant. E. g.: return ''.join(w for w in text if w.isupper()) # or even: return ''.join(filter(str.isupper, text)) More
First-Bogdymoto3
Hi, 1. In `checkio` you can use list comprehension: def checkio(data): return [x for x in data if nrre(data,x) > 1] # nrre is like str.count so def checkio(data): return [x for x in data if data.count(x) > 1] More
First-Bogdymoto3
Hi, _bin()_ returns __str__ and it has a _str.count()_ method, so you don't need that for loop: return bin(number).count('1') More
First-0x41
Hi, `value` is redundant. With a list comprehension and _len()_, or with _sum()_ it could be shorter and nicer. More
First-0x41
Hi, 1. __str__ is immutable so it's not the best type in this case. 2. _filter()_ or generator expression + "".join() would be better, e. g.: return filter(str.isupper, text) More