22
narimiran
7 24 41
2882/ 2945
Last seen 5 years ago
Member for 8 years, 4 months
Difficulty Normal
Would like to receive comments/critics of my published solutions.

Best reviews / Newest reviews
First-milind1992
Line 15: no need to create a special function to return negation, just use Python's: return (not x) or y More
Secret Message eh?-kunkka71
You don't need to import string if you check if ch.isupper() More
easy to learn-p4leno
Lines 6 and 7 are not needed. Also, line 4 can be written just like: if znak.isupper(): More
First-jollyca
Line 30: rather than use string concatenation, using format is preferred: def __repr__(self): return 'Building({}, {}, {}, {}, {})'.format( self.south, self.west, self.width_WE, self.width_NS, self.height) More
First-rolandp
Good job, [Mr. Norvig](http://norvig.com/sudopy.shtml) ;) More
list.pop() and list.insert()-bryanandrade
1. collections.deque is more suitable than list for popping and inserting on different sides... 2. ...and if you choose deque, you can skip popping and inserting all together, by using deque.rotate More
First-patrat88
Line 27: rather than use string concatenation, using format is preferred: def __repr__(self): return 'Building({}, {}, {}, {}, {})'.format( self.south, self.west, self.width_WE, self.width_NS, self.height) More
Moore Neighbourhood-narimiran 1
Changed the line 8 to: neighbours = sum(sum(hood) for hood in neighbourhood) since @veky said in a recent comment that sum is "clearer, faster and more consistent with that subtraction later" than count. More
Simple-Sisyphus
Your first line could be written as: stripped = [c.lower() for c in text if c.isalpha()] More
Constraint based-johnhaines
Lines 5-8 can be written simply as: constraint = min(capacity, number) Lines 12-18 could be simplified by using list comprehension: sides_to_paint = [i for i in range(number)] * 2 (This is a random review - sorry if this has already been mentioned) More
First-lexin13 1
On line 13, more pythonic way would be the thing you did in line 8: return not stack More
First-sergeyt
In your last line, there's no need for if-else, just have it like this: return prepared(first_word) == prepared(second_word) More
FastBall-morpho4444
Line 23: rather than use string concatenation, using format is preferred: def __repr__(self): return 'Building({}, {}, {}, {}, {})'.format( self.south, self.west, self.width_WE, self.width_NS, self.height) More
First-kapranowroman
Lines 4-11 could be replaced with: if i in '({[': lastopen.append(i) Lines 30-33 could be replaced with: return not lastopen # the same as: return len(lastopen) == 0 More
First-derfunkenfliegenauf
No need for bool in line 13, just do: return not stack More
Euclidean Recursion-jad2192 1
Lines 7-9: r_0, r_1 = r_1, r_0 % r_1 More
Network Loops-narimiran
Lines 2-4 changed to: points = {point for pair in connections for point in pair} More
First-evilmind
1. You import itertools and you don't use it 2. No need for if-else in line 3, you can just return it like this: return sorted(first_word.lower().replace(" ", "")) == sorted(second_word.lower().replace(" ", "")) More
First-SukumarBurra
Line 2: you can create list just by: l = [] Lines 8 and 10: good job knowing integer other than 0 is 'truish' (if len(l)), but you can similarly just check if the list is not empty by: "if l", no need for 'len'. More
AZ-aziz199505
Line 6 could be written as: if stack: stack.pop(0) And line 7 is not needed. More
1 2 3
4
5 6 7 8 9 10