Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

I. Learning to Program > 9. Python’s Built-in Functions

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 used by Python programmers. I’ll describe what they do and how to use them, and then show examples of how they can help in your programs.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint