Introduction to Python Classes - Object-Oriented Python

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
542 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 22, 2011

In this Python video tutorial we demonstrate how to create a base Python class, which is really just a custom data type. We create a Python object using a magic constructor (__init__), then change an attribute, as well as print out the object using the __str__ method.

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (fireboxtraining)

  • Useful video! However, is there a way to change class attributes in instances?

  • @pdeteresa - what exactly are you trying to accomplish? If you are not implementing encapsulation using private attributes, you can simply create the attributes on the fly using dot notation with the instance. However, using private attributes is a better practice. We'll try to upload another video tutorial on implementing private attributes soon.

see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • awesome... thanks!

  • Easy to understand and usefull! Is that private attributes means loading data from outside?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more