57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 12 hours ago
Member for 11 years, 6 months, 6 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.
Hmm...
(letter.isblah() for letter in data) ~~~> map(str.isblah, data) [call it `contains`]
And that `if not somecond: return False` is much clearer written as just `return somecond`.
return len(data) < 10 and contains(str.isupper) and contains(str.islower) and contains(str.isdigit)
More
Why `k` and `p`? And while we're at it, why `o` and `l`? :-O
More
That max with 0 seems really ugly in a Clear solution... having another if would be too much for you? :-)
More
The same as [Aperiodic](https://py.checkio.org/mission/periodic-table/publications/veky/python-3/aperiodic/), only readable. :-D If you ever wanted to see how that one worked, but didn't have courage to tackle it. :-]
More
A nice puzzle: can you explain why
data[-1] += data.pop()
doesn't work the same? And why does it work the way it does? :-)
More
At the end, just `return not stack`.
And ALL_SYMBOLS, while you're chaining, could use
chain.from_iterable(SYMBOLS.items())
:-)
More
Unpack, don't index!
for file, rank in pawns:
for neighbor in neighbors[file]:
above = str(int(rank) - 1)
if neighbor + above in pawns:
More
[Now your class has two methods, one of which is `__init__`.](https://youtu.be/o9pEzgHorH0?t=460)
(And the other method is not even named `call` --- it is in fact a `staticmethod`.:-P)
Please don't do this. (And please watch the whole video if you're not convinced.) Functions are fine without mean
More
By "it" you mean the mission, or your solution? :-)
More
It's very awkward how you handle the case when item is a number. I really think it is convoluted code.
More