ITI 1120 Chapter 7: ITI1120 - Chapter 7
Document Summary
We"ve seen a lot of functions: built-in-functions, functions inside modules, and functions that we"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: well explore hoe to use methods and how they differ from the rest of the functions. Module is a kind of object one that can contain function and other variables. There is another type of object that is similar called class. You"ve been using classes all along, probably without realizing it: a class is how python represents a type. We cal call str to create a string ex) str(17) "17". We can also use str to call a method in class str. Every method in class str requires a string as its first argument.