Is there a tutorial on learning simple one liners like this? I find myself frustrated after seeing simple and obvious solutions like the above, but can never bring myself to code them as such.
I'm only half kidding. The best way to get used to using functional concepts is to actually use them in their native setting, and then apply (giggle) them elsewhere. When you _have_ to solve problems this way, at some point, it clicks.
I can say that it has indeed improved my Python scripting as well.