57
veky
22 48 64 Leader of the month
44587/ 53887
Last seen 2 hours ago
Member for 11 years, 6 months, 7 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
First-Nguyen_Dang_Thai 1
OMG... if this is clear, I am a marsupial. :-P More
Using list count-johngraham 1
str also has .count. You don't need a list. More
First-tivvit 1
I think set(blah) & set(nyeh) is still nicer than set(blah).intersection(nyeh). But not much. More
binary logic-bunnychai 1 1
LOL about that "-1" in line 8... isn't it more clear to use slicing? f0, f1 = map(bin(first)[2:].count, "01") More
hard way-theholy7 1 1
Pytonic way of writing switch is not enormous ifchain, but a dict. Great advantage is that names and codes are next to each other, so you can see what's what. def boolean(x, y, operation): code = dict( conjunction = x and y, disjunction = x or y, impl More
First-nsmirnoff 1
:-) Even if you _did_ want to convert words to a list (though there is no reason for that here), there is a nicer and explicit way: for y in list(words): More
First-ciel 1 1
It's fascinating that the same solution, somebody puts under puzzle, somebody under clear. :-P More
Raising head and cutting tail-LukeSolo 1
If you really want a faster algorithm, use collections.deque instead of list. Line 8 is O(n), and deque.popleft is O(1). More
oneliner-tivvit 1
Instead of lambda with \*, you can use `operator.mul`. Or if you don't want to import one module more, you can use `int.__mul__`. int(z) is duplicated, since this is the reverse of usual listcomp paradigm: you need map first, then filter over that. So you can use the building blocks directly. More
Bubble without bubble-tivvit 1
Why line 6? Tuple has all the interface you need. Nice algo, of course it can be expressed with sum. sum(val1 < val2 for end, val1 ... for val2 ...) More
1-liner: +marriage-przemyslaw.daniel 1 1
Now, this is a real puzzle. :-D Did you first write/find the joke and then realized it can be used here, or did you search for / wanted to construct a relatively short joke that had "checkio?sum" as a casefolded subsequence, and found this one? (Of course, my [Magnum Opus](https://py.checkio.org/mi More
First-nbaramichai 1
Interesting idea to use numpy to solve the system. However the system is modular, so you have to guess k (additional number of turns) so the whole thing becomes a bit clumsy. (But still, explicit loop would probably be better than recursion with a default parameter.) Numpy _can_ be exploited to More
Rotate floor-veky 1 1
What does "* 2" do? And why without it code doesn't work? ;-) More
First-santosh.pagare 1 1
Lines 4,5,6: digits = lowers = uppers = 0 Line 1: unnecessary. :-) Lines 8~13: digits += c.isdigit() lowers += c.islower() uppers += c.isupper() or if you insist on using unbound method, remove initialization and just say digits = sum(map(str.isdigit, data)) Lines 15~18: More
First-techdoctranslator 1 1
Well, that's obvious. :-) Although, line 5 could be result.extend(flat_list(item)), to better parallel the result.append(item). More
import median-cougarmilk 1
You can rename while importing: from statistics import median as checkio ;-) More
Second-techdoctranslator 1 1
Good. Now, let's try to invert our logic a little. We have two "moments of truth": in one case, we call extend and we do call flat_list on the item, while in another, we call append and we do not call flat_list on the item. Every other combination is either an error, or nonsense. Can we have _one_ m More
eval(f"{op}({x},{y})")-flpo 1 1
Yup, Python has finally got its unquote operator. :-D Of course, you can also do it [without eval](https://py.checkio.org/mission/boolean-algebra/publications/veky/python-3/an-operator-by-any-other-name/?ordering=most_voted&filtering=all). :-) More
First-bunnychai 1
Nice and transparent, if a bit boring, especially those at the beginning. A few details: * if z in Special.keys(): you don't need .keys . dict knows how to check containment itself. * ''.join accepts a generator. ''.join(...) is more readable, memory efficient, fast and overall pythonic (not t More
First & boring-smilicic 1 1
Not boring at all. That [Chekhov's product](https://en.wikipedia.org/wiki/Chekhov's_gun) in first line is very interesting. I deeply wonder what was its intended purpose in the never-revealed third line. :-DD More