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
Patrick-pdtpatrick 1
Hi, look at _any()_. That `bool(sum(...))` is quite ugly. 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
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
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
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
First-sumeet.lintel 1
Why should this be called "most readable style"? :) Now in a more constructive way: 1. Have you heard about [PEP8](https://www.python.org/dev/peps/pep-0008/) or some "linters" e. g. [pylint](http://www.pylint.org/)? ([online PEP8 check](http://pep8online.com/)) 2. The backslashes are not necessary More
Second-feraxis
May I suggest? (data.isalnum() != True) == not data.isalnum() When you want split an expression to multiple lines just but it parentheses as there can be line breaks inside parentheses. E. g. this is valid code: ([1,2,3,4,5,6], [9,5,6,7,8,9]) More
First-feraxis
You can omit the number variable. More
First-aotus
I like this: even, odd = [word[x::2] for x in (0,1)] More
First-StereoCat
Hi, () on lines 11, are redundant. More
First-StereoCat
Hi, look at _extended slices_ (`array[::2]`) and _negative indices_ (`array[-1]`). More
First-StereoCat
Thumbs up for `for...else` even is if you don't need it here :) More
First-StereoCat
Hi, look at `//`, e. g.: number = number // 10 # or even: number //= 10 # or: number, n = divmod(number, 10) a.append(n) More
First-StereoCat
Hi, `b` and `s` are redundant: return round(max(args) - min(args), 3) More
First-StereoCat
Hi, use consistent indendation. More
First-StereoCat
Hi, 1. _bin()_ return __str__ so _str()_ on line 2 is redundant. 2. You don't need `b`. 3. You don't need the for loop, as there's a _str.count()_ method. More
functools & operator-otonvm
Hi, you could use _int.\_\_mul\_\_()_. More
First-StereoCat
Hi, `fabs` is redundant `abs` is enough. More
First-StereoCat 1
Hi, 1. `first` and `second` are strings so _str()_ is redundant. 2. Look at _list comprehensions_ and _generator expressions_ or _filter()_: result = [word for word in b if word in a] result = filter(a.__contains__, b) # or even: return "".join(sorted(filter(a.__contains__, More
First-StereoCat
Hi, 1. `sequence` is iterable, so line 6 is redundant. 2. Look at _enumerate()_. 3. `range(0, len(a)) == range(len(a))` count = 0 for i, x in enumerate(sequence): for y in sequence[i:]: if x > y: count += 1 return count # or with sum() and More