Welcome to this repository, which contains Jupyter Notebooks and PDF files covering advanced topics in the Python programming language, with a focus on Object-Oriented Programming (OOP) and other advanced concepts. The course is divided into sections, each containing detailed explanations with practical examples.
- Introduction to Object-Oriented Programming (OOP):
- What is Object-Oriented Programming? Why is it important?
- Basic concepts: Classes, Objects, Attributes, and Methods.
- Creating Classes and Objects:
- How to define classes and create objects.
- Using the constructor (
__init__
) to initialize objects.
- Attributes and Methods:
- The difference between public and private attributes.
- How to define methods within classes.
- Magic Methods:
- Explanation of magic methods like
__str__
,__len__
,__add__
, and more. - How to use them to improve code performance.
- Explanation of magic methods like
- Practical Exercises:
- Creating a bank account with deposit, withdrawal, and balance display functions.
- Inheritance:
- How to create subclasses from base classes.
- Using
super()
to access attributes and methods of the parent class.
- Polymorphism:
- The concept of polymorphism and how to implement it in Python.
- Practical examples of polymorphism.
- Encapsulation:
- How to use encapsulation to protect data and control access.
- The difference between public, protected, and private attributes.
- Getters and Setters:
- How to use getters and setters to control access to private attributes.
- Practical Exercises:
- Creating a library and managing books using OOP.
- Magic Methods:
- Detailed explanation of magic methods like
__init__
,__str__
,__len__
,__add__
, and more. - How to use them to improve code efficiency.
- Detailed explanation of magic methods like
- Inheritance:
- How to create subclasses from base classes.
- Using
super()
to access attributes and methods of the parent class.
- Practical Exercises:
- Creating classes to represent animals using inheritance.
- Polymorphism:
- The concept of polymorphism and how to implement it in Python.
- Practical examples of polymorphism using classes.
- Encapsulation:
- How to use encapsulation to protect data and control access.
- The difference between public, protected, and private attributes.
- Practical Exercises:
- Creating classes with encapsulation to control data access.
- Getters and Setters:
- How to use getters and setters to control access to private attributes.
- Practical Exercises:
- Creating classes with getters and setters to manage data.
- You can open
.ipynb
files using Jupyter Notebook or JupyterLab. - Each file contains detailed explanations with practical examples that you can run directly.
- You can modify the code and experiment with it to better understand the concepts.
- The PDF files contain theoretical explanations for each part of the course.
- You can use them as a quick reference or to review the concepts.
- You can download and read them on any device that supports PDF files.
To run the Jupyter Notebooks smoothly, you need the following environment:
- Python 3.x: You can download Python from the official website.
- Jupyter Notebook or JupyterLab: You can install it using the following command:
pip install notebook jupyterlab
If you want to deepen your understanding of Object-Oriented Programming (OOP) in Python, you can check out the following resources:
-
Object-Oriented Python: Master OOP by Building Games and GUIs
- This book provides a comprehensive and detailed explanation of Object-Oriented Programming in Python, with practical examples.
- It is a strong reference for deeply understanding OOP and applying it in real-world projects.
- The book is authored by Irv Kalb, known for his clear and simplified teaching methods.
- If you want to master OOP in Python, this book is a must-read and an indispensable reference.
-
Object-Oriented Python Tutorial by TutorialsPoint
- This guide from TutorialsPoint provides a simplified and clear explanation of Object-Oriented Programming in Python.
- It includes practical examples and direct applications to facilitate understanding of basic and advanced OOP concepts.
- It is an excellent reference for both beginners and advanced learners.
- If you want a quick start and practical understanding of OOP, this guide is an ideal choice.
If you have any questions or inquiries, feel free to reach out to me:
- Name: Momen Mohammed Bhais
- Email: momenbhais@outlook.com