"Python Basics (2015)" was retired on June 22, 2018. You are now viewing the recommended replacement.
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
Start creating object structures using Python's class keyword.
-
class- the keyword you use in Python to create an object - Instantiation - creating an object from a class by calling the class like a function
- Instance - the object that was instantiated (created) Ex:
Car() -
isinstance(object, type, or class)- check if an object is an instance of the given type or class
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
But what does that look
like in Python code?
0:00
Let's use our car example to build out an
object, or class as it's called in Python.
0:04
Use the workspaces attached to
this video to follow along.
0:11
You can also download the file and
use an IDE of your choice if you'd rather.
0:15
In Python objects are created
using the class keyword and
0:24
the name of your class
with a colon like this.
0:27
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