© J. Burton Browning and Marty Alchin 2019
J. Burton Browning and Marty AlchinPro Python 3https://doi.org/10.1007/978-1-4842-4385-5_3

3. Functions

J. Burton Browning1  and Marty Alchin2
(1)
Oak Island, NC, USA
(2)
Agoura Hills, CA, USA
 

At the core of any programming language is the notion of functions, but we tend to take them for granted. Sure, there’s the obvious fact that functions allow code to be encapsulated into individual units, which can be reused rather than being duplicated all over the place. But Python takes this beyond just the notion of what some languages allow, with functions being full-fledged objects that can be passed around in data structures, wrapped in other functions, or replaced entirely by new implementations.

In fact, Python ...

Get Pro Python 3: Features and Tools for Professional Development 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.