40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 4 days
Difficulty Advanced
Best reviews / Newest reviews
"short" comprehension list -val0u
Hi, `range(0, x) == range(x)`. More
3 regex-val0u
Hi, those `bool()` aren't necessary. You could write: return bool(len(data) >= 10 and num.search(data) and upper.search(data) and lower.search(data)) # or even: return len(data) >= 10 and all(x.search(data) for x in (num, lower, upper)) More
Passchek using any()-lameei
Hi, the `if...else...` is redundant: return any(...) and any(...) and ... # is enough More
Monkey Typing-EfGnevsheva
Hi, this is not pythonic. E. g. line 6: `if s in text:` More
Three words-EfGnevsheva
Hi, `return` is a statement not a function. Parentheses are redundant. More
Even the last-EfGnevsheva
Hi, 1. look at [_extended slices_](https://docs.python.org/3.5/whatsnew/2.3.html?highlight=extended%20slices#extended-slices). 2. `if not array:` is enough. More
Verify anagrams-EfGnevsheva
Hi, 1. You could write: `return w1 == w2` 2. __str__ is iterable => lines 2 and 3 are redundant. More
Common Words-EfGnevsheva
Hi, look at [__(frozen)set__](https://docs.python.org/3.5/library/stdtypes.html#set-types-set-frozenset). More
House password-EfGnevsheva
Hi, if condition: return False else: return True is an antipattern. It's equivalent to: return not condition More
Digits Multiplication-EfGnevsheva
Hi, 1. __str__ is iterable => line 3 is redundant. 2. You could write `r *= i` instead of `r = i*r`. 3. `c` is redundant. You can use the list comprehension in for loop on line 6. 4. You could also solve it using _functools.reduce()_. More
First-Narsiba 1
Hi, for non-empty list: `array[-1] == array[len(array)-1]`. More
First-johanna1109
Hi, you could write: if not array: ... # instead of: if len(array) == 0: ... # and: if array: ... # instead of: if len(array) != 0: ... More
First-johanna1109
Hi, 1. Line 17 is redundant. 2. Instead of lines 13-17 you could write: `return c == 3` More
First-johanna1109
Hi, 1. Line 3 is redundant. 2. You can nest method calls: return ','.join(phrases).replace('right', 'left') More
golf-minto
Great job! Much nicer than mine :) More
First-Dima_Tkachuk
Hi, 1. This is an anti-pattern: if condition: return False else: return True # You could write: return not contdition 2. `True == 1` and `False == 0` so: return not((not upp) or (not low) or (not dig)) # or shorter: return upp and low and dig More
First-Legat
Hi, in fact _checkio()_ is equals to _sum()_, so you could write: checkio = sum More
First-ZestyPickles
Hi, 1. __str__ is iterable. You could write `alphabet = "abcde...xyz"` 2. or `from string import ascii_lowercase`. More
First-ZestyPickles
Hi, look at [_enumerate()_](https://docs.python.org/3/library/functions.html?highlight=enumerate#enumerate) built-in. More
First-ZestyPickles
Hi, all the nested `if`s are redundant. __bool__ is subclass of __int__. You could write e. g.: elif operation == 'equivalence': return x == y More