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

Best reviews / Newest reviews
Ugly-afana_daniel 3 1
Line 22: 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-Kolahzary 2 1
There are several things that can be learnt/improved here: 1. I already mentioned in one other your solution - there's no need to use `len(a)-1`, just `-1` would be enough for reaching the last index. 2. You don't need to create a list in the comprehension just to find its sum. You can skip [ and ] More
use set object-kurosawa4434 2 1
One of the better solutions I've seen so far (I'm doing random reviews for all published solutions)! Probably because I really like using sets whenever I can :) Some minor things: Line 6: no need to iterate through values, you can simply do: all_users = sum(users.values()) Lines 17 and 24: ` More
First-Kolahzary 2
Instead of defining the lambda function for a key, there's a simpler solution that serves the same purpose: key=abs More
First-rajesh27071992 1
Some cosmetic changes: Lines 6-8: for i, char in enumerate(string2): if char.isalpha(): string1 += char.lower() it is more readable, and you don't need line 9. The same can be done in lines 10-13. Also, you can create empty lists and dicts like this: countdict = {} More
First-ljy95135 1
Line 10: return str_b.rjust(8, '0') Similarly, line 38: str_b = str_b.ljust(32, '0') Lines 40-45: str_ip = '.'.join(bin_without0b_8bit_to_ip(str_b[i:i+8]) for i in range(0, 32, 8)) More
Iterate the ABC-Mr.Geekman 1
It might be easier/faster to write your line 3 (and 4) as: abc = list('abcdefghijklmnopqrstuvwxyz') Or even easier/faster is to import string.ascii_lowercase ;) More
First-gaa7par 1 1
Line 8, why not: median = data[median_plus] Also, is there a need for 'median_minus' when you can have it just as 'median_plus - 1' when needed? More
Second-rajesh27071992 1
Line 2 - you can sort the original list, without creating a new variable by using list1.sort() This "int(len(list2)/2)" you use three times - it would be better to create a new variable (before the if-loop). Also, there exists //, which is integer division so you don't need to convert to int. More
First-rajesh27071992 1 1
Couple of things here: 1. You don't need outer parenthesis in lines 7 and 9. 2. There's more 'pythonic' way of iterating than your line 6. 3. Line 5 - variables in Python are usually named_like_this, not namedLikeThat. Putting it all together, your code becomes: def checkio(list1): More
y = -1, becuause resons (donno)-halvorfladsrudboe 1
You might want to know about string method .isalpha(), it might have helped you here More
Iterate the ABC-Mr.Geekman 1
Lines 2 and 3 - you don't have to type all that: from string import ascii_lowercase abc = tuple(ascii_lowercase) More
First-h0d 1 1
If you would like to avoid avoiding that last ',' - a better idea would be to store each phrase in a list, and then return a string of all phrases in a list, separated by ',': txt = [] for phrase in phrases: txt.append(phrase.replace("right", "left")) return ','.join(txt) More
First-ljy95135 1
Line 8: maybe something like this: for col, row in pawns: would help with the readability later. Also, I would put checking for left and right guard in the same if-loop. So you'd have something like this: for col, row in pawns: if ((chr(ord(col) - 1) + str(int(row) - 1)) in pawns More
First-finpingvin 1 1
This is a random review so I don't know if it's been already said because I don't see other comments, but: Why not make _first and _second a sets, so you can do intersection as well.... intersection :) def checkio(first, second): _first = set(first.split(',')) _second = set(sec More
First-KyleTheKernel 1
I'm starting to sound like a broken record (I've said the same thing in last few comments), but - there's a // operator that gives you integers, so you don't have to use 'int'. For example, line 4: return x[len(x)//2] More
Second-Vincent_Fan 1 1
Nice usage of divmod! You don't have to create 'data_sort' - your first line can be as simple as 'data.sort()' and then later you can just use 'data'. More
First-edutilos 1 1
This is a random review so I don't know if anyone else commented the same thing - your lines 7 to 18 could/should be simplified by using operators for xor, and, or: sum_xor += str(int(i) ^ int(j)) sum_and += str(int(i) & int(j)) sum_or += str(int(i) | int(j)) More
First-zcjsword 1 1
Your first two lines could be written easier/simpler with: text = text.lower().replace(' ', '').splitlines() (This is a random review, sorry if this has already been mentioned before) More
Iterate, Comparisons, Sum Operators (and, or, xor), Combine Result-John.Hammell 1
Line 7: you don't have to have '0b' to convert binary number to an int, creating empty strings would work too. Lines 11 to 26 could be simplified by using operators and, or, xor - no need for all those conditions. for x in a: and_sum = ""; or_sum = ""; xor_sum = "" for y in b: More
1
2 3 4 5 6 7 8 9 10