57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 1 day 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.
I didn't think I'd ever post an [NSFW link](https://xkcd.com/853/) to CiO, but there's a first time for everything. :-D
More
Yes, you should use string.translate. But you should use [all of its capabilities](https://py.checkio.org/mission/caesar-cipher-decryptor/publications/veky/python-3/punctuation-as-junk/?ordering=most_voted&filtering=all), not fall back to regex for such a simple thing as deleting extraneous characte
More
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
"len(stack) != 0" is more simply written as just "stack" inside conditionals. Sequences can bool. :-)
More
I put those chars @StefanPochmann generously provided me to good use - traded them for spaces at a favorable exchange rate. :-D
[Of course, now someone will make a 'vfn' solution without spaces. But that's just too predictable.:]
More
> because it is soo clear and logical if I was the person who invented its commands and structure.
In fact it's better than this. ;-) http://www.slideshare.net/didip/why-i-love-python, slide 3. ;-)
> This proves me the fact that really needs to exist a universal aesthetics in the world of programm
More
You can use `chars[~i]` for ith char flipped.
And divmod can be useful.
More
> 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
Neither fast nor particularly compact. And ugly as a toad. :-P At least learn to [loop like a native](http://nedbatchelder.com/text/iter.html). :-9
More
angles really could have been a list of dicts, not of tuples. At least namedtuples. angles[1][0] just seems incredibly unpythonic to me. :-)
And you could have imported radians from math, it would help readability of your radians function. 648000 is a really magic number, it only reminds me of "648
More
Lambdaizing an expression just for a call buys you nothing. `key=abs`.
And the first lambda can be replaced by a partial, which is usually a win.
More
Trivial generator expression doesn't buy you anything. `sum(array[::2])` is enough.
Also, `a * b` or `a*b`, but not `a *b`. Reminds me of `int *p` too much. :-D
More
You mean, besides [PEP(hundreds=4, tens=6, ones=8)](https://www.python.org/dev/peps/pep-0468/)? ;-)
More
This one is the most similar to mine, I guess. But still a bit more complicated. :-)
More
Either go fully with PEP8 (and put _two_ blank lines separating `min_max` from the rest of the code), or delete empty line 6 (much better in this case, I'd say). This way, line 7 is sticking like a sore thumb. :-o
For line 4, you can use EAFP style. Not really important, but might be nice to learn
More
What's this epidemic separation of return with two empty lines from the rest of the function?? Where do you get this idea, people? :-/
More
Not everything is a generator. Sometimes you want to jump through the recursion. Exceptions do that nicely. Call/cc would be cooler, but Python won't get it until Py4000. :-D
More
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
To paraphrase Blaise Pascal, "I have made this solution longer than usual, because I lacked the time to make it short". ;-)
More