6 Functions and Lambdas
Functions are one of the most elementary concepts in programming, yet Python packs a surprising amount of versatility into them. You’ll recall from Chapter 3 that functions are first-class objects, so they are treated no differently from any other object. This fact, combined with the power of dynamic typing, opens up so many possibilities.
Python has full support for functional programming, a distinct paradigm from which we get those “lambdas,” or anonymous functions, you keep reading about online. If you’re used to languages like Haskell or Scala, a lot of the concepts in this chapter are going to seem familiar to ...
Get Dead Simple Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.