June 2, 2016, 5:15 a.m. |
+ 1 |
for Comment
veky: That's not _wrong_, that's just needlessly complicating things. Same as if x > 5: return True else: ...
|
June 1, 2016, 11:09 a.m. |
+ 1 |
for Comment
hrvoje: Line 23 is very creative, awesome! Have some thumbs :)
|
May 30, 2016, 1:46 p.m. |
+ 1 |
for Comment
DiZ: Is is called an [A* algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm) ;-)
|
May 30, 2016, 1:09 a.m. |
+ 1 |
for Comment
Lasica: I'd like to put some light on mysterious t21 and t31 lists. For other reviewers wondering how does t...
|
May 27, 2016, 9:11 a.m. |
+ 1 |
for Comment
veky: While you're there, take a look at Counter. Extremely useful class. :-)
|
May 27, 2016, 9:10 a.m. |
+ 1 |
for Comment
veky: Yes. The usual answer to "why Python has no switch statements" is "because it has dicts". ;-)
|
May 27, 2016, 2:54 a.m. |
+ 1 |
for Comment
veky: Imagine you have a list x of million items. What does x.pop(0) do? * it returns x[0] * it sets x[0] ...
|
May 27, 2016, 2:26 a.m. |
+ 1 |
for Comment
DiZ: This is an heap-based Dijkstra's algorithm: it constructs the right path by testing all possibilitie...
|
May 27, 2016, 2:21 a.m. |
+ 1 |
for Comment
veky: It's strange that you didn't reuse area in volume. And if you want to be a wizard, corners can be mu...
|
May 25, 2016, 2:23 p.m. |
+ 1 |
for Comment
veky: Yes. You'll notice that the "essence" of a solution, try/except lines, are getting drowned in increa...
|
May 25, 2016, 10:44 a.m. |
+ 1 |
for Comment
veky: It can be anything callable (returning an int-like thing). Look: class Bandersnatch: def __call__(se...
|
May 25, 2016, 10:20 a.m. |
+ 1 |
for Comment
veky: As I told you in another comment, all CiO wants is (in the true ducktyping manner) something it can ...
|
May 25, 2016, 10:07 a.m. |
+ 1 |
for Comment
veky: Imagine if the system was different. Imagine the task says: you have an integer named n. Write a sta...
|
May 25, 2016, 7:42 a.m. |
+ 1 |
for Comment
veky: `lambda` is not a function, it is a way of constructing functions (like `def` is, for example). But ...
|
May 25, 2016, 7:35 a.m. |
+ 1 |
for Comment
veky: Nice. Even I didn't know timedelta has \_\_abs\_\_. :-)
|
May 24, 2016, 10:15 a.m. |
+ 1 |
for Comment
veky: Listcomp is usually ok if you really do want a list as an output. Here you don't: you want str, so y...
|
May 24, 2016, 10:13 a.m. |
+ 1 |
for Comment
veky: The truth is (as always), it depends. Not _everything_ in Python is adapted completely to EAFP style...
|
May 24, 2016, 10:13 a.m. |
+ 1 |
for Comment
veky: It is short because the task is simple. Ideal programming language should have solutions of approxim...
|
May 24, 2016, 8:44 a.m. |
+ 1 |
for Comment
veky: "Clever compiler" would have to be _much_ more clever than you think. It's perfectly possible that "...
|
May 24, 2016, 8:35 a.m. |
+ 1 |
for Comment
veky: Many. :-) EAFP. Read [this](http://www.checkio.org/mission/number-radix/publications/tdietert/python...
|
May 17, 2016, 7:50 a.m. |
+ 1 |
for Comment
halo107: I also use chrome for mac and meet the same problem as you, every time, I check the view-source of t...
|
May 17, 2016, 5:49 a.m. |
+ 1 |
for Comment
Sim0000: My solution use Dijkstra only. We can see given map as two layer map with extra direction up and dow...
|
May 9, 2016, 7:05 a.m. |
+ 1 |
for Comment
veky: Algorithm that doesn't work doesn't work, no matter how many tests it doesn't pass. :-)
|
May 9, 2016, 6:57 a.m. |
+ 1 |
for Comment
bryukh: That means in rings you can find all numbers from 1 to N.
|
May 7, 2016, 4:42 a.m. |
+ 1 |
for Comment
veky: LOL. The shorter I write the code, the longer the explanations in the comments are. :-D Good work. :...
|
May 3, 2016, 7:44 a.m. |
+ 1 |
for Comment
narimiran: Line 10: return str_b.rjust(8, '0') Similarly, line 38: str_b = str_b.ljust(32, '0') Lines 40-45: st...
|
May 3, 2016, 7:43 a.m. |
+ 1 |
for Comment
narimiran: Line 8: maybe something like this: for col, row in pawns: would help with the readability later. Als...
|
May 3, 2016, 7:43 a.m. |
+ 1 |
for Comment
narimiran: > I think it’s clear but seems has lots of ways to optimize… You already imported calendar - why did...
|
April 24, 2016, 2:22 a.m. |
+ 1 |
for Comment
veky: You _only_ have to know (or dare to hope:) that there is a module to do what you want. Then you go t...
|
April 20, 2016, 3:33 a.m. |
+ 1 |
for Comment
zcjsword: @ljy95135 I am happy to. As mentioned in my headline comments, no need to loop through the entire ye...
|
April 20, 2016, 1:09 a.m. |
+ 1 |
for Comment
veky: len([x for whatever if cond]) ~~~> sum(cond for whatever) Faster, shorter, less memory-intensive and...
|
April 20, 2016, 12:57 a.m. |
+ 1 |
for Comment
veky: > eye-opening. The title is suggestive. ;-) > Seems that as long as knew a module or method exists b...
|