Книга: Practical Programming, Fourth Edition
Назад: Exercises
Дальше: Modules, Classes, and Methods

Chapter 7
Using Methods

So far, you’ve seen lots of functions: built-in functions, functions inside modules, and functions that you’ve defined. A method is another kind of function that is attached to a particular type. There are str methods, int methods, bool methods, and more—every type has its own set of methods. In this chapter, you’ll explore how to use methods, and also how they differ from the rest of the functions that you’ve seen.

Назад: Exercises
Дальше: Modules, Classes, and Methods