40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 3 days
Difficulty Advanced
Best reviews / Newest reviews
First-vankhang.nguyen.1
You can remove this: if number>0 and number <= 1000: else: None The is enough as all the tests meet this condition. More
Beginners soloution to "Even the last"-jfleet12
It's a matter of taste but: This is more __noisy__ than clear, especially these boxes from # and the print statement are really not necessary. This # return sum(array[0::2])* array[-1] is quick and clear. It would be clear enough to add a long comment explaining what [0::2] and array[ More
Mapping the eight directions while checking the limits-Prasanna.kumar.GLV
1. See my comment about ifs to your solution of House Password 2. Shorthand: a = a + 1 the same as a += 1 Try to look at [assignment operators](http://www.tutorialspoint.com/python/python_basic_operators.htm). :) More
Regular Expressions -Prasanna.kumar.GLV
Two small things: 1. You can directly rename the argument i. e. def checkio(password):... 2. The if clause is not necessary. You can replace: if : return True else: return False with: return More
Index Power (Solution)-Yoratheon
The return None in your code is never reached, you may remove it. More
Even the last (Solve)-Yoratheon
Few tips: array[len(array) - 1] == array[-1] # there's no need to write len(array) n = n + 1 --> n += 1 0 % 2 == 0 # you can omit n == 0 in your if clause The code in else branch doesn't have to be in else branch. More
First-subaru
_nbin_ and _mbin_ are both _str_ which is iterable there for using list() in lines 10 and 11 is superfluous. And also you can write: size = max(len(nbin), len(mbin)) More
First-tkm-tyler
In this case you can use _int_ instead of _lambda c: int ( c )_. More
First-khoa.nguyen.9822924
bin() already return a str so you don't need to do str(bin(result)). More
using "bitwise exclusive or"-johnhaines
Why not return bin(n ^ m).count("1") ? More
First - The Hamming Distance-AQiccl135 1
You can use the [str.rjust](https://docs.python.org/3/library/stdtypes.html?highlight=str.rjust#str.rjust) method for this: fill = abs(len(n) - len(m))*'0' if len(n) < len(m): n = fill + n else: m = fill + m More
First-Plazer
You don't have to use third variable two swap values of two variables. You can simply write: if n < m: m, n = n, m instead of: if n < m: tmp = n n = m m = tmp More
Second-ultrajack
Good job! There's no redundancy. And it's even safer than it has to be, as all inputs in the tests are already sorted :) More
First-ryosms
A few comments: 1. In fact lines 5-7 are superfluous as a, b and c don't have to be sorted. 2. Then: a, b, c = length is the same as a = length[0] b = length[1] c = length[2] 3. Consider creating a separate function from: round(degrees(acos((b * b + c * c - a * a) More
First-fourat05
This code is a good candidate for refactoring. Look at the _cos = ..._ and _angles ..._ lines (5 - 10). There's exactly the same pattern 3 times. Consider to create a separate function at least for _cos = ..._ lines. More
First-veil
You can avoid the duplication on lines 15 and 16. E. g.: a_1, a_2 = (round(math.degrees(math.asin(height/lengths[i]))) for i in (0, 1)) More
First-tnoda
Small thing: This is a good example where you can use lambda instead of nested def. More
Verify Anagrams-Bassmaster
You could write: return first_letters == second_letters instead of: if first_letters == second_letters: return True else: return False More
First-boubisko
One small thing: if x==y: return True return False is the same as: return x == y More
First-Reloader
This is a bit "noisy": One of the _for_ s is superfluous. With (e. g. list) comprehension and using all() you can reduce the remaining _for_ and _return_ to one line. More