Chapter 9. Python’s Built-in Functions

Python has a well-stocked box of programming tools, including a large number of functions and modules that are ready-made for you to use. Like a trusty hammer or a bicycle wrench, these built-in tools—chunks of code, really—can make writing programs a lot easier.

As you learned in Chapter 7, modules need to be imported before they can be used. Python’s built-in functions don’t need to be imported first; they’re available as soon as the Python shell starts. In this chapter, we’ll look at some of the more useful built-in functions, and then focus on one: the open function, which lets you open files in order to read and write from them.

Using Built-in Functions

We’ll look at 12 built-in functions that are commonly ...

Get Python for Kids now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.