Object-Oriented Programming (OOP) and Advanced Python Topics
Keep adding new skills with 10,000+ programs for $239 (usually $399). Save now.
Object-Oriented Programming (OOP) and Advanced Python Topics
This course is part of Python - Complete Python, Django, Data Science and ML Guide Specialization
Included with
Ask Coursera
Recommended experience
Recommended experience
What you'll learn
Learn how to use Python's advanced OOP features such as inheritance, encapsulation, and polymorphism.
Master the implementation of decorators for function enhancements, including logging, validation, and authentication.
Understand and apply Python generators for efficient memory usage and iteration over large datasets.
Gain proficiency in handling files, including CSV, JSON, zip archives, and managing SQLite databases in Python.
Skills you'll gain
Details to know
See how employees at top companies are mastering in-demand skills
Build your subject-matter expertise
- Learn new concepts from industry experts
- Gain a foundational understanding of a subject or tool
- Develop job-relevant skills with hands-on projects
- Earn a shareable career certificate
There are 22 modules in this course
This course features Coursera Coach!
A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Master advanced Python topics by diving deep into object-oriented programming (OOP) concepts such as classes, methods, inheritance, polymorphism, and encapsulation. You’ll gain a strong foundation in Python’s advanced features including decorators, generators, magic methods, and working with databases. This course will help you improve the efficiency and structure of your Python code, providing hands-on experience in solving real-world programming challenges. Throughout the course, you’ll explore each advanced topic step by step, starting with the fundamentals of OOP and progressing to complex applications. You'll learn how to implement Python’s powerful features, such as decorators for function modifications and generators for memory-efficient loops. We’ll also explore classes and objects, the heart of OOP, showing how inheritance, encapsulation, and polymorphism work together. Additionally, you'll tackle database management using SQLite and learn how to handle files, including CSVs and zip archives. This course is perfect for intermediate Python learners who want to elevate their programming skills and work with real-world applications. You'll engage with practical examples and exercises, such as creating a forum, managing users, and utilizing databases. By the end of this course, you'll have a comprehensive understanding of advanced Python techniques and the confidence to apply them to professional software projects.
In this module, we will explore Python's object-oriented capabilities, focusing on defining classes, creating instances, and manipulating object attributes. We will dive into the usage of the 'self' parameter, method invocation through dot notation, and the role of the 'init' method in object initialization. Through practical examples, you'll gain a solid understanding of object creation, inheritance, and encapsulation in Python.
What's included
5 videos2 readings1 assignment
5 videos•Total 51 minutes
- Classes and Objects•8 minutes
- Practice - Understanding Classes and Class Instances•10 minutes
- Practice - Adding Instance Attributes through Dot Notation•9 minutes
- Adding Instance Attributes using the ..init.. Method•12 minutes
- Practice - Incorporating Own Instance Attributes with the ..init.. Method•12 minutes
2 readings•Total 20 minutes
- Introduction to the course 'Object-Oriented Programming (OOP) and Advanced Python Topics'•10 minutes
- Full Course Resources•10 minutes
1 assignment•Total 15 minutes
- Classes and Objects - Assessment•15 minutes
In this module, we will explore the differences between instance methods, class methods, and static methods, emphasizing when to use each in Python programming. You’ll learn how to leverage static methods to perform class-related tasks without requiring an instance, and how to manage class-level data with class attributes. Practical examples will illustrate how to implement these techniques for effective object-oriented programming.
What's included
6 videos1 assignment
6 videos•Total 49 minutes
- Instance vs Class Methods•12 minutes
- Practice - Inheriting Methods by the Instances•11 minutes
- Static Class Methods•4 minutes
- Practice - Utilizing Static Methods in Classes•11 minutes
- Class Attributes•2 minutes
- Practice - Working with Class Attributes•9 minutes
1 assignment•Total 15 minutes
- Instance and Class method - Assessment•15 minutes
In this module, we will dive into Python's magic methods, which allow user-defined classes to handle specific operations such as addition and comparison. By exploring practical examples like the __add__ and __eq__ magic methods, you'll learn how to customize how objects behave when combined or compared. These techniques will enhance your ability to design more intuitive and flexible class interactions.
What's included
2 videos1 assignment
2 videos•Total 15 minutes
- Magic Methods in Classes•6 minutes
- Practice - Utilizing Magic Methods in Classes•9 minutes
1 assignment•Total 15 minutes
- Magic Methods in Classes - Assessment•15 minutes
In this module, we will explore class extension through inheritance, focusing on how derived classes can inherit methods from parent classes while adding new functionality. You will learn how to extend classes to create specialized types, such as an AdminUser class from a base User class, enabling more complex and flexible class structures. Through practical examples, you'll gain a deeper understanding of inheritance in Python and how to design reusable and scalable object-oriented solutions.
What's included
2 videos1 assignment
2 videos•Total 16 minutes
- Inheritance from Other Classes•6 minutes
- Practice - Extending Classes•10 minutes
1 assignment•Total 15 minutes
- Classes Extension - Assessment•15 minutes
In this module, we will walk through building a functional forum system in Python, focusing on creating and linking classes for users, posts, and the forum itself. You will learn how to register users, associate posts with specific users, and create methods to find posts and users based on various attributes. By the end of the module, you'll also see how to enhance your code with type annotations for better clarity and maintainability, ensuring your class interactions are clean and efficient.
What's included
7 videos1 assignment
7 videos•Total 37 minutes
- Example - Creating Forum, User, and Post Classes•7 minutes
- Example - Creating Instances of the Forum, User, and Post Classes•7 minutes
- Example - Methods for Finding Users by Username and Email•6 minutes
- Example - Method for Finding All Posts by a Specific User•7 minutes
- Example - Retrieving User Posts by Email•4 minutes
- Example - Adding Parameter Types•2 minutes
- Example - Wrapping up the Forum, Users, and Posts Example•3 minutes
1 assignment•Total 15 minutes
- Classes in Practice - Assessment•15 minutes
In this module, we will explore the four key principles of Object-Oriented Programming: encapsulation, inheritance, polymorphism, and abstraction. You'll learn how encapsulation protects object states, how inheritance promotes reusability, and how polymorphism and abstraction help create flexible and simplified code. These concepts form the foundation of OOP and will guide you in designing efficient, scalable, and maintainable systems.
What's included
4 videos1 assignment
4 videos•Total 23 minutes
- Encapsulation in Object-Oriented Programming (OOP)•4 minutes
- Inheritance in Object-Oriented Programming (OOP)•6 minutes
- Polymorphism in Object-Oriented Programming (OOP)•9 minutes
- Abstraction in Object-Oriented Programming (OOP)•5 minutes
1 assignment•Total 15 minutes
- Key Principles in Object-Oriented Programming (OOP) - Assessment•15 minutes
In this module, we will explore the core concept of Python modules, learning how to group related functions, variables, and classes in a single file for better code organization. You’ll gain hands-on experience in importing entire modules, selectively importing specific elements, and managing module imports across various subfolders. By the end, you’ll be able to structure your code more efficiently, creating modular and reusable Python projects.
What's included
5 videos1 assignment
5 videos•Total 33 minutes
- Modules•8 minutes
- Practice - Importing Entire Custom Modules•8 minutes
- Practice - Selective Imports from Other Modules•6 minutes
- Practice - Importing between Different Modules•7 minutes
- Practice - Modules in Subfolders•4 minutes
1 assignment•Total 15 minutes
- Modules - Assessment•15 minutes
In this module, we will dive into Python's extensive library of built-in modules, offering ready-to-use functionalities that save time and effort. You will also gain practical experience importing and utilizing these modules to enhance your code with minimal setup. This will enable you to take full advantage of Python's powerful standard library in your projects.
What's included
2 videos1 assignment
2 videos•Total 8 minutes
- Built-in Modules•6 minutes
- Practice - Importing from Built-in Modules•2 minutes
1 assignment•Total 15 minutes
- Built-in Modules - Assessment•15 minutes
In this module, we will explore the __name__ and __main__ constructs in Python, learning how to control the flow of execution in your code. You will see how to ensure functions run only when a script is executed directly, as opposed to being imported. Additionally, we will dive into Python packages, teaching you how to structure and organize your project for better maintainability and scalability.
What's included
3 videos1 assignment
3 videos•Total 23 minutes
- Practice - _name_ and _main_•11 minutes
- Example - Executing Functions only when Module is run Directly•6 minutes
- Practice - Packages in Python•6 minutes
1 assignment•Total 15 minutes
- What is __name__ and __main__ - Assessment•15 minutes
In this module, we will delve into JavaScript Object Notation (JSON), focusing on its syntax and widespread use for data exchange. You will gain hands-on experience converting Python objects to JSON and vice versa, while also learning how to format dictionaries using JSON for improved readability. Through practical tasks, you will solidify your knowledge of handling JSON effectively within your Python projects.
What's included
5 videos1 assignment
5 videos•Total 35 minutes
- JavaScript Object Notation (JSON)•12 minutes
- Practice - Converting Python Objects to JSON•8 minutes
- Practice - Converting from JSON to Python Objects•9 minutes
- Practice - Formatting Dictionaries using JSON•4 minutes
- TASKS - JSON•2 minutes
1 assignment•Total 15 minutes
- JavaScript Object Notation (JSON) - Assessment•15 minutes
In this module, we will cover the essentials of working with files in Python, including reading, writing, and managing files and directories. You’ll dive into file operations using both the os module and the more modern Path class, learning how to safely delete files and directories. You will also explore best practices such as using the with statement for optimal file handling. Through practical tasks, you’ll reinforce your understanding and ability to manage files effectively in Python projects.
What's included
11 videos1 assignment
11 videos•Total 78 minutes
- Working with Files•12 minutes
- Working with Files and Directories using the os Module•12 minutes
- Removing Files and Directories using the os Module•3 minutes
- Summary of Directory and File Operations using the os Module•4 minutes
- Working with Files and Directories using the Path Class•11 minutes
- Iterating over Directories and Removing Files using the Path Class•10 minutes
- Reading and Writing Files•6 minutes
- Writing and Reading Files using the built-in open Function•6 minutes
- Using the with Statement•9 minutes
- Removing Files using unlink•3 minutes
- TASK - Files•1 minute
1 assignment•Total 15 minutes
- Working with Files - Assessment•15 minutes
In this module, we will explore the zipfile module, which allows you to create, manage, and extract files from zip archives in Python. You will learn how to create zip archives for compressing data and efficiently read and extract contents from existing zip files. By the end of the module, you’ll be proficient in using zip archives for managing large datasets and files in your Python projects.
What's included
2 videos1 assignment
2 videos•Total 18 minutes
- Built-in zipfile Module and Creating Zip Archives•8 minutes
- Reading from the Zip Archive•9 minutes
1 assignment•Total 15 minutes
- Working with zip archives - Assessment•15 minutes
In this module, we will explore the basics of working with CSV files in Python, including reading and writing data while addressing common challenges specific to the CSV format. You’ll also gain hands-on experience iterating over each row in a CSV file, extracting data for processing or analysis. This will equip you with the skills to work efficiently with CSV data in Python.
What's included
2 videos1 assignment
2 videos•Total 17 minutes
- Working with CSV Files•9 minutes
- Iterating over Each Row in the CSV File•8 minutes
1 assignment•Total 15 minutes
- Working with CSV Files - Assessment•15 minutes
In this module, we will dive into Python’s datetime module to learn how to handle and manipulate dates and times efficiently. You will gain hands-on experience with the datetime class for date-time operations, converting strings to datetime objects, and utilizing the timedelta class for working with time intervals. Additionally, we will explore the time module to handle time-based functionalities, enhancing your ability to manage dates and times in your Python projects.
What's included
5 videos1 assignment
5 videos•Total 32 minutes
- Built-in datetime Module•5 minutes
- Examples - Using the datetime Class•7 minutes
- Examples - Converting Strings to Datetime Objects•7 minutes
- Example - Working with the timedelta Class•4 minutes
- Built-in time Module•8 minutes
1 assignment•Total 15 minutes
- Working with Dates and Times - Assessment•15 minutes
In this module, we will explore Python's random and secrets modules to generate random numbers, selections, and secure tokens. You will learn how to use methods like choices and shuffle for randomizing sequences, as well as how to generate cryptographically secure tokens and one-time passwords. Additionally, we’ll cover how to generate strong, secure passwords, ensuring your Python applications are both functional and secure.
What's included
5 videos1 assignment
5 videos•Total 52 minutes
- Built-in random Module•7 minutes
- Examples - Utilizing choices and shuffle Methods from the random Module•12 minutes
- Built-in secrets Module•11 minutes
- Examples - Generating CSRF Tokens, URL-Safe Tokens, and OTP Passwords•8 minutes
- Example - Generating Strong Passwords•14 minutes
1 assignment•Total 15 minutes
- Generating Random Sequences and Passwords - Assessment•15 minutes
In this module, we will explore Python's math module, which provides a wide range of mathematical functions to simplify complex calculations. Additionally, we’ll dive into recursion, learning how to design and use recursive functions to break down problems into simpler subproblems. By the end of this module, you will be able to apply both mathematical operations and recursion in your Python programs to solve a variety of challenges.
What's included
2 videos1 assignment
2 videos•Total 12 minutes
- Built-in math Module•4 minutes
- Recursive Functions•8 minutes
1 assignment•Total 15 minutes
- Math Module and Recursive Functions - Assessment•15 minutes
In this module, we will dive into Python’s powerful re module to explore regular expressions (regex) and their use in string manipulation. You’ll learn how to create patterns for matching strings, validate email addresses, replace substrings, and clean up unnecessary spaces in text. The module also includes a practical challenge focused on verifying password strength and structure, helping you apply regex techniques in real-world scenarios.
What's included
6 videos1 assignment
6 videos•Total 30 minutes
- Built-in re Module for Regular Expressions•10 minutes
- Example - Creating Patterns for Matching•5 minutes
- Example - Email Validation using Regular Expressions•7 minutes
- Example - Substring Replacement using Regular Expressions•2 minutes
- Example - Removing Excessive Spaces using Regular Expressions•4 minutes
- TASK - Password Verification•1 minute
1 assignment•Total 15 minutes
- Regular Expressions - Assessment•15 minutes
In this module, we will cover the process of setting up a local SMTP server using smtp4dev in a Docker container for email testing. You will learn how to send emails programmatically using Python’s SMTP protocol, and enhance email content by integrating HTML templates for better formatting. The module concludes with best practices for cleaning up your testing environment by removing the Docker container.
What's included
4 videos1 assignment
4 videos•Total 29 minutes
- Running smtp4dev SMTP server in a Docker Container•6 minutes
- Sending an Email using SMTP•11 minutes
- Formatting an Email using an HTML Template•10 minutes
- SMTP Wrap-Up and Removing the Docker smtp4dev Container•2 minutes
1 assignment•Total 15 minutes
- Sending Emails - Assessment•15 minutes
In this module, we will explore SQLite3 databases in Python, starting with how to create a database and design tables for data storage. You will practice inserting data into tables and retrieving it through SQL queries. The module concludes with a summary of SQLite concepts and key takeaways, solidifying your understanding of how to work with databases in Python.
What's included
4 videos1 assignment
4 videos•Total 26 minutes
- Creating an SQLite3 Database and Table•10 minutes
- Writing Data into the SQLite Table•6 minutes
- Reading Data from the SQLite Table•5 minutes
- SQLite Summary•5 minutes
1 assignment•Total 15 minutes
- Working with SQLite Database - Assessment•15 minutes
In this module, we will explore various other useful built-in Python modules, starting with the array module for efficient data storage and manipulation. You'll learn how to save and load arrays to and from files, manage program arguments with the sys module, and automate browser interactions using the webbrowser module. These tools will expand your ability to write more powerful and versatile Python programs.
What's included
4 videos1 assignment
4 videos•Total 27 minutes
- Built-in array Module•6 minutes
- Saving Arrays to Files and Reading Arrays from Files•4 minutes
- Accessing Program Arguments using the built-in sys Module•7 minutes
- Built-in webbrowser Module•10 minutes
1 assignment•Total 15 minutes
- Other Built-in Modules - Assessment•15 minutes
In this module, we will dive into Python virtual environments and PIP, learning how to manage project dependencies efficiently. You’ll explore how to create isolated environments for each project, activate and deactivate them, and install necessary packages. The module also covers saving package lists using a requirements.txt file and addressing challenges in package management, ensuring smooth and reproducible development setups.
What's included
8 videos1 assignment
8 videos•Total 41 minutes
- Introduction to PIP - Package Manager for Python•8 minutes
- Using a Globally Installed requests Package•4 minutes
- Uninstalling Globally Installed Packages using PIP•2 minutes
- Creating a Python Virtual Environment•5 minutes
- Activation and Deactivation of the Virtual Environment in the Shell•3 minutes
- Installing Packages within the Virtual Environment•6 minutes
- Saving a List of Installed Packages in a Requirements Text File•8 minutes
- Challenges of Package Management using Requirements Files•5 minutes
1 assignment•Total 15 minutes
- Virtual Environments - Assessment•15 minutes
In this module, we will explore Pipenv as a powerful tool for managing Python virtual environments, simplifying dependency management, and ensuring isolated project setups. You will learn how to set up, install, and update packages within Pipenv environments, as well as recreate environments in new project folders. Additionally, we’ll explore how to integrate both venv and Pipenv with the PyCharm IDE to create a more efficient and seamless development experience.
What's included
7 videos1 reading3 assignments
7 videos•Total 44 minutes
- Installing pipenv for Virtual Environments Management•4 minutes
- Creating a Virtual Environment using pipenv:•6 minutes
- Installing Packages using pipenv:•7 minutes
- Updating Packages using pipenv:•4 minutes
- Recreating Virtual Environment in the Project Folder using pipenv:•8 minutes
- Using venv for Virtual Environments in PyCharm:•6 minutes
- Using pipenv for Virtual Environments in PyCharm:•10 minutes
1 reading•Total 10 minutes
- Conclusion to the course 'Object-Oriented Programming (OOP) and Advanced Python Topics'•10 minutes
3 assignments•Total 90 minutes
- Full Course Practice Assessment•15 minutes
- Pipenv for Virtual Environments Management - Assessment•15 minutes
- Full Course Assessment•60 minutes
Earn a career certificate
Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.
Instructor
Explore more from Software Development
- P
Packt
Course
- Status: Free Trial
Course
- Status: Free Trial
Course
Why people choose Coursera for their career
Frequently asked questions
Yes, you can preview the first video and view the syllabus before you enroll. You must purchase the course to access content not included in the preview.
If you decide to enroll in the course before the session start date, you will have access to all of the lecture videos and readings for the course. You’ll be able to submit assignments once the session starts.
Once you enroll and your session begins, you will have access to all videos and other resources, including reading items and the course discussion forum. You’ll be able to view and submit practice assessments, and complete required graded assignments to earn a grade and a Course Certificate.
More questions
Financial aid available,
