Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Object-Oriented Python Instant Objects Methods

What is an instance of a class or method?

how do i establish one in a class and how do i use an instance?

1 Answer

Shay Paustovsky
Shay Paustovsky
969 Points

Hi Elisha,

What you're describing right now is part of the OOP Paradigm (Object-Oriented-Programming). Now I don't have experience in Python but I have in other OOP-languages.

Class - Imagine that you have a car: the car has properties (color, model, maker, etc..) and action it can take (drive, stop, turn engine, etc...) A class is simply a way to abstract those details.

Instance- Is simply the object, but unless you have assigned default values for properties in your object you will probably instantiate it i.e - make a copy of it and give it a name. later you can access it's properties and methods

Method- Is a fancy word for function, the only difference is that methods act on the properties inside an object and functions are global.

Hope this helped

HAPPY CODING

thank you!