
Object-oriented programming (OOP) is a programming paradigm that revolves around the concept of objects. An object is a bundle of data (attributes) and associated procedures (methods) that act upon the data. Think of objects as real-world entities—like a car, a person, or a book—each with its own unique properties and behaviors. OOP encourages the organization of code into reusable, modular components, enhancing code readability, maintainability, and scalability. Key principles of OOP include encapsulation, inheritance, and polymorphism, which help in creating robust and flexible software solutions.
Explore object oriented programming by building a person class with a constructor, using self to store name and age, and creating multiple objects from a single blueprint.
Discover how magic methods in Python, defined with double underscores, power object behavior—like initialization, string representation, length, equality, and ordering—using a book class with title, author, and pages.
Explore how self acts as the default argument for Python methods, distinguish functions from methods, and create objects with constructors to see how methods are invoked.
Create a custom Python class for fractions with a constructor for numerator and denominator and a __str__ method that prints fractions such as 3/4 when you instantiate and print objects.
Define instance variables as per-object storage that gives each object its own name, balance, and pin in an ATM class, demonstrated through constructor initialization and per-object data display.
Demonstrate pass by reference in Python by passing a customer object to a function and printing greetings based on the object's name and gender.
Explain encapsulation by hiding confidential details using access modifiers. Demonstrates with an ATM class, showing public access, and converting to private with double underscores to protect balance and pin.
Explore encapsulation in Python and how private variables are stored through name mangling. See how _ClassName__var can still be accessed, and why this simple design invites responsibility.
Explore encapsulation in python with getters and setters for private data in an atm example. See how get_pin and set_pin enforce access control and safe updates.
Learn how to manage objects in Python OOP by storing them in lists, dictionaries, and tuples, and understand mutability versus immutable sets through a customer class example.
Explore public, protected, and private access modifiers in Python, learn how to declare them (plain, single underscore, and double underscore), and understand inheritance implications and access errors.
Learn how inheritance reduces code duplication by sharing registration and login methods between student and instructor, enabling code reuse, simpler classes, and respecting private members.
Illustrates single inheritance in Python by using a user base class with login and register methods and a student subclass that adds enroll and checkout, demonstrating access to parent methods.
Learn hierarchical inheritance in Python by extending a single base class 'user' into 'student' and 'instructor', with methods such as checkout, enroll, login, and earnings.
Explore polymorphism and its three forms—method overriding, method overloading, and operator overloading—and note Python's lack of overloading versus C++ and Java.
Learn how the super keyword invokes the parent class constructor from a child class, enabling proper initialization and access to parent methods in Python object oriented programming.
Explore operator overloading in Python, giving operators new meanings to perform multiple tasks. See how the plus operator adds numbers and concatenates strings, and how the star operator repeats strings.
Build a Python object oriented ATM app that creates accounts, checks balances, deposits, and withdrawals using a dictionary of pins and private methods in a class.
In this course, we'll explore a fun way to write computer programs called 'object-oriented programming' or 'OOP'. Think of it like building with blocks. Each block is like a special thing called an 'object'. We'll start with the basics. We'll learn what objects and classes are. Objects are like the things around us, like a car or a cat. Classes are like blueprints for making those things. We'll learn how to make our own objects and use them to solve problems.
One cool thing we'll learn is called 'inheritance'. It's like passing down traits from parents to children. In programming, it means we can reuse code from one class in another class. This makes our programs easier to understand and saves us time.
We'll also learn about 'encapsulation'. It's like putting things in a box. We'll keep some things hidden inside our objects and only show what's necessary. This makes our programs safer and easier to use.
By the end of the course, you'll be able to create your own programs using OOP. You'll be able to make things like a pretend ATM machine, where you can deposit and withdraw money. You'll also be able to model real-world things like cars and animals.
So, if you want to become a better programmer and build cool stuff, this course is for you! Get ready to have fun and learn some awesome new skills!