Loading video player…

Python Basics: Object-Oriented Programming (Overview)

OOP, or object-oriented programming, is a method of structuring a program by bundling related properties and behaviors into individual objects.

Conceptually, objects are like the components of a system. Think of a program as a factory assembly line of sorts. At each step of the assembly line, a system component processes some material, ultimately transforming raw material into a finished product.

An object contains both data, like the raw or preprocessed materials at each step on an assembly line, and behavior, like the action that each assembly line component performs.

In this video course, you’ll learn how to:

  • Create a class, which is like a blueprint for creating an object
  • Use classes to create new objects
  • Instantiate classes with attributes and methods

This video course is part of the Python Basics series, which accompanies Python Basics: A Practical Introduction to Python 3. You can also check out the other Python Basics courses.

Note that you’ll be using IDLE to interact with Python throughout this course. If you’re just getting started, then you might want to check out Python Basics: Setting Up Python before diving into this course.

Download

Sample Code (.zip)

1.5 KB
Download

Course Slides (.pdf)

5.2 MB

00:00 Welcome to Python Basics: Object-Oriented Programming. That’s quite a hefty term. What does it even mean? Object-oriented programming is just a fancy way to say that you rely heavily on objects when writing code.

00:15 Keep watching this course to find out what kind of objects we’re talking about.

00:20 Object-oriented programming makes coding easier. It doesn’t really affect the end non-coding user. If your end user was a programmer, and you were coding a library, then it would. Object-oriented programming also doesn’t directly affect the behavior of a program.

00:37 You can write a program without object-oriented programming, and it will be able to work in exactly the same way as one that is written with object-oriented programming. That said, it can make the program easier to understand and maintain.

00:53 Programs that are easy to understand and maintain may make your program better in general, because it’s easier to extend. You can, of course, go overboard with object-oriented programming.

01:05 You need to think of this as just another set of tools that you can take advantage of when writing code with Python. So in this course, you’ll be getting an idea of what object-oriented programming is all about.

01:19 You’ll start to understand why OOP, which stands for object-oriented programming, is useful. Every language that uses OOP has slightly different terminology around it, and in this course, you’ll be learning all the Python jargon. For instance, in Python, objects are created from classes, which are a sort of blueprint for the object.

01:41 So you’ll be creating classes and instances of these classes.

01:46 You’ll be equipping your classes with instance constructors. This will build your objects exactly the way you want them.

01:55 You’ll attach attributes, or bits of information, to your classes and instances. You’ll manipulate your class instances or objects and compare them with each other. And finally, you’ll be furnishing your classes and instances with methods and special methods so that they can act when called upon. And with that, let’s get stuck into object-oriented programming in Python.

Become a Member to join the conversation.