Defining Functions and Using Built-ins
Josh Juneau, Jim Baker, Victor Ng, Leo Soto, Frank Wierzbicki · Apress eBooks · 2010
Functions are the fundamental unit of work in Python. A function in Python performs a task and returns a result. In this chapter, we will start with the basics of functions. Then we look at using the built-in functions. These are the core functions that are always available, meaning they don’t require an explicit import into your namespace. Next we will look at some alternative ways of defining functions, such as lambdas and classes. We will also look at more advanced types of functions, namely closures and generator functions. These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.