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
First-DanielHendrycks
Hi, what about?: from datetime import date ... More
First-DanielHendrycks
Hi, this is all but pythonic. Try to look at for...else. P. S.: I've played with your code. Result is [here](http://www.checkio.org/mission/house-password/publications/suic/python-3/with-forelse/). More
Definitely more generic than it needed to be :)-FabioZadrozny
Hi, I would say: Definitely more complicated than it has to be be :D E. g. those lambdas are redundant: conditions = [str.isupper, str.islower, str.isdigit] Tip: Look at _all()_, _any()_ and _generator expressions_. More
First-artyomushko
Hi, what is creative in this solution? More
Oneline-Saimon51
Hi, why not `reduce(bool.__and__, ...)`? Why not ___all()___? Yes, you don't need that lambda. More
First-artemoniux
Hi, you could use _set comprehension_: def check_pangram(text): R = {letter for letter in text.lower() if letter.isalpha()} return len(R)==26 # and finally get rid of R: def check_pangram(text): return len({letter for letter in text.lower() if letter.isalpha()} More
First-artemoniux 1
Hi, 1. Line 2 and 7 are pointless. You don't need to declare `i`. Assigning `B` to `data` does nothing. Why don't you return `B`? 2. You don't need `B`: B = [i for i in data if data.count(i) > 1] # data = B # per 1. is pointless # return data # per 1. is pointless retur More
First-yellow_man
And she's buying a stairway to m3 ... oops.. heaven More
Third-Wienands
Hi, you could use _sum()_: return sum(chr(ord(pawn[0])-1)+str(int(pawn[1])-1) in pawns or chr(ord(pawn[0])+1)+str(int(pawn[1])-1) in pawns for pawn in pawns) More
Normally Solved-Golli19
Hi, this is an anti-pattern: if (x == 1 and y == 0) or (x == 0 and y == 1): return True else: return False # is equivalent to: return (x == 1 and y == 0) or (x == 0 and y == 1) More
First-evdel
Hi, you can use `*` to unpack `date1` and `date2`: f = datetime.date(*date1) More
First [one liner]-splinter12345
Hi, 1. I see 4 lines ([one-linerized :)](http://www.checkio.org/mission/unlucky-days/publications/suic/python-3/one-liner/)) 2. `calendar` isn't used. 3. You could write: `sum(cond for i in range(1, 13))` instead of `sum(1 for i in range(1, 13) if cond)` More
First-Limanskida.
Hi, 1. Use `and` not `&`. 2. You can use _all()_ instead of chaining _and()_. More
Monkey Typing-RafaelSPinto 1
Hi, look at _sum()_: return sum(word in text for word in words) More
Days Between-RafaelSPinto 1
Hi, you can use `*` to unpack `date1` and `date2`. More
Right to Left-RafaelSPinto 1
Hi, what about: return ','.join(phrases).replace('right', 'left') # instead of lines 2-4? More
First-hiya-m 1
Hi, lambda is redundant: return filter(str.isupper, text) More
First-solgrey
Hi, that `n + 1` is redundant. You could write: if len(array) > n: return array[n] ** n else: return -1 # or even: if len(array) > n: return array[n] ** n return -1 More
First-rrsony22
Hi, 1. That `if...elif...elif` is redundant. Those are not special cases. The only special case is _empty list_. 2. Don't use semicolons in Python. 3. Those `B-E` variables are redundant. Why not?: return sum(array[::2]) * array[-1] More
First-nls
Hi, last if is redundant: return re.match("(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*[0-9].*)", data) is None # or even: return len(data) >= 10 and re.match("(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*[0-9].*)", data) is None More