57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 15 hours ago
Member for 11 years, 6 months, 24 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.

Best reviews / Newest reviews
Password Checker (input mask)-UndeadMonkey 1 1
First, at the start, you need or. if len(data) < 10 or data == data.lower() or data == data.upper(): return False Or even better... ... or data in {data.lower(), data.upper()}: You don't need line 11. list is iterating through your str the same way for would do. for item in More
First-xiaozhan 1 1
:-) If you're going to use `len() and`, you can use it in at least two other missions. Try to find them. ;-] More
Python is cool :)-sirmax 1
> Python is cool :) You have no idea. :-D First, you don't have to write your uppercase. Just from string import ascii_uppercase Also, that if can be much better placed _after_ for. Then you don't need singular else. ''.join(ch for ch in text if ch in ascii_uppercase) And of course, th More
First-tivvit 1
... if array ... is much better than ... if len(array). If you really want to use len(array), you can use and. :-) len(array) and sum(...)*... More
Cycle detection-DiZ 1 1
Yup, that's the one. If elements of r are only pairs, it's simplest. Though it seems not the shortest. ;-) break_rings=lambda r:min(map(len,map(set,__import__("itertools").product(*r)))) More
cheat \^.^/-bunnychai 1
Many other cheats are possible. See my solution for possibilities. :-) More
House p_word-BossRaker 1
Nice, but "flag" is a bit technical. Wouldn't it be nicer as: has_upper = has_lower = has_digit = False And you don't need `()` about `len(data) >= 10`. Python has sensible precedence rules, mostly. :-] More
bad but surprise-magdre 1 2
What's bad and what's surprise here? (except CiO Python finally supports yield from:). I consider isinstance(x, list) a bit nicer than type(x) == list. And it will work for subclasses of list too. ;-) More
auto-painting-bunnychai 1
Great! BTW you don't need [] in argument for join. More
First-enkeyz 1
Why "else: pass"? Those are completely superfluous. More
First-xiaozhan 1 1
Nice. BTW squeezed-space operators like ** and even > can be ok, but after the colon there should really be a space. (Unless you're golfing, but in that case you can save a lot more chars - even spaces.:) More
First-xiaozhan 1 1
First, don't map lambda, use genexps: tuple(map(lambda x: number%x == 0, [3,5])) ~~~> tuple(not number%x for x in [3,5]) (Also, as you see, not is smart and can be used here for greater readability: 'there is no remainder'.) Second, in last line, that pattern is clearer coded using dict.get: More
Simple-gflegar 1 1
Python relations can be chained (as in math). check can be written as g[r][c] == g[r + dr][c + dc] == g[r + 2*dr][c + 2*dc] != '.' BTW, Guido usually recommends that when you have mixed priority operators, operators binding tighter shouldn't be space-separated from their arguments (see abo More
Short and sweet-LewisFogden 1
It could be, maybe not shorter, but surely sweeter: from functools import partial checkio = partial(sorted, key=abs) More
endswith-LewisFogden 1
Line 3 is really superfluous. Just say "for other\_word in words\_set - {word}:". The fact that you named it "other\_words" doesn't help much semantically (especially when other\_word is iterating through it), and it gives the reader one more name (and one more line) to think about. More
First-pohmelie 1
Now when people ask me how dimpleqonx works, I'll just point them to your code. Thanks. :-D More
First-bukebuer 1 1
Here is your code, halved: import itertools, operator def trim(lists): if lists: first, *rest = lists for t in [first] + [first[::-1]]*(first[0]!=first[1]): for remains in trim(rest): yield [t] + remains else: yield [] def sqgen More
First-coells 1 1
Nice twist. You could have gotten away with slicing (or re.sub), instead of that boring replace. ;-) More
Slicing-LewisFogden 1
This is much easier as a sum of bools. ;-) More
the obvious way-tivvit 1
Line 6: `if number % 5 == number % 3 == 0` More