O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Functions and Functional Programming

MOST SUBSTANTIAL PROGRAMS ARE BROKEN UP into functions for better modularity and ease of maintenance. Python makes it easy to define functions, but borrows a number of ideas from functional programming languages that simplify certain tasks. This chapter describes functions, anonymous functions, generators, and functional programming features, as well as the eval() and execfile() functions and the exec statement. It also describes list comprehensions, a powerful list-construction technique.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required