This repository was developed and tested using Python 3.11. It is recommended to use Python 3.10 or newer for best compatibility.
This repository contains a series of Python scripts and class files designed to help you learn and practice Object-Oriented Programming (OOP) concepts in Python. The exercises and code samples are organized sequentially, each building on the previous lessons to reinforce key OOP principles.
Step-by-step OOP exercises and examples, covering:
- Classes and objects
- Attributes and methods
- Inheritance
- Encapsulation
- Polymorphism
- Special methods (dunder methods)
- Working with CSV files
- oop07instances.csv: Sample data file used in one of the exercises for demonstrating file I/O with classes.
oop11 Project:
- oop11_item_class.py, oop11_phone_class.py, oop11_main.py: Example of a small project structure with multiple classes and a main script, focusing on item and phone classes.
oop12 Project:
- oop12_item_class.py, oop12_phone_class.py, oop12_main.py: Further extension of the previous project, introducing more advanced OOP concepts.
oop13 Project:
- oop13_item_class.py, oop13_main.py: Additional practice with class design and usage.
oop14 Project:
- oop14_main.py: Standalone script for a specific OOP exercise.
oop15 Project:
- oop15_keyboard_class.py, oop15_main.py: Project files focusing on a keyboard class and its usage.
- oop16.py: Additional OOP exercise building on previous concepts.
- practice01.py to practice05.py: Extra practice problems and challenges
- practice01.py: Basic practice problem
- practice02.py & practice02Upgraded.py: Practice with variations
- practice03.py & practice04.py: Intermediate challenges
- practice04again.py: Alternative implementation
- practice05.py: Binary tree practice problem
The structure and exercises in this repository are inspired by the YouTube tutorial series:
Object Oriented Programming (OOP) in Python - Full Course by freeCodeCamp.org
or similar OOP Python tutorials available online. The code is organized to follow a progressive learning path, making it suitable for beginners and intermediate learners.
- Start with the earliest files (oop01.py) and progress sequentially.
- Read the code, run the scripts, and experiment with modifications.
- Use the CSV file and multi-file projects to understand real-world OOP applications.
- Refer to the tutorial video or notes for additional explanations.