Glossary · Phase 0 · Tools
Method
A function that belongs to an object, called with a dot, like name.upper().
Try it now
Watch the clicks variable. Each call to add runs with self pointing at the same object, so its count builds from 10 to 15 to 18.
Learn it properly
Classes and objects · Bundle data with the functions that work on it. About 30 minutes.
Other terms from the same lesson
- class: A template for making objects that bundle data with the functions that work on it.
- object: One thing made from a class, with its own data, like one customer record.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.