Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Basic Object-Oriented Python!
You have completed Basic Object-Oriented Python!
Preview
Add instance attributes to further customize each object created with your class.
- Attributes = the name in Python for the properties of an object
- Instance attributes = attributes that are created when an object is instantiated
- Method = a function inside of a class
- Dunder method = a nickname for a method that has double underscores before and after its name (Ex:
__init__)
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
create an object of our class.
0:00
Instance attributes will also
be created when we instantiate
0:01
an instance of our class.
0:05
We do this by adding
an initializer to our class.
0:08
The initializer is a function or
method as it's called in a Python class.
0:12
It's placed inside of our car class.
0:18
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up