• Blind4Basicscommented on "Build a square" python solution

errrr.... it's actually a good question... x)
3 years later, I'd actually say it's perfectly fine in this situation (I guess I had in mind something about saturation of the memory with the extra list, but in most situations you won't see any problem. Now, if n is huge, you'll run into troubles anyway, but not necessarily because of the approach itself, but rather because of the size of the string you have to build...)

ccl: forget that message.

• cekstedtcommented on "Build a square" python solution

Could you elaborate on which specific aspect of the above code is dangerous or footgun-y?

• jolitoscommented on "Simple transposition" python solution

I just can't believe, simple like that.

• iNviNcib1ecommented on "Find the Difference in Age between Oldest and Youngest Family Members" python solution

I say this in 7 out of 10 cases when i see solution from other people :))))

• pavloslavcommented on "Regexp Basics - is it a eight bit unsigned number?" python solution

It does the job. Check out other solutions.

• opittcommented on "Regexp Basics - is it a eight bit unsigned number?" python solution

REGEX ... "Regexp Basics"
you are missing the point

Typical.

It's short

• akar-0commented on "Multiplication table for number" python solution

Join puts a separator (here '\n') between the elements of an iterable, so not at the beginning nor at the end.

• Ye-jicommented on "Multiplication table for number" python solution

It's clever but not the best practice. It lacks readability.

• pavloslavcommented on "Some (but not all)" python solution

It's still O(n).

• Kacarottcommented on "Some (but not all)" python solution

It's fine! Learning is what's important :)

• geanscommented on "Some (but not all)" python solution

Thanks @Kacarott, I really didn't know. Thanks for that lesson.

• Kacarottcommented on "Some (but not all)" python solution

@geans You are overlooking one important thing. `map` does NOT go through the whole list. It creates a generator, which produces values one at a time, which feeds into the other functions, which short circuit.

Here is proof:

``````def infinite():
while True: yield 1

a = map(lambda x: x*2, infinite()) # Works instantly
b = [x*2 for x in infinite()] # Loops forever (timeout)
``````
• Blind4Basicscommented on "Some (but not all)" python solution

man, just read my comment again: there is no difference in the present context...

:/