A curated collection of Python modules completed during the 42 Madrid curriculum, covering a progressive path from language fundamentals to more advanced topics such as object-oriented programming, exception handling, data structures, file operations, polymorphism, package imports, abstract programming patterns, environment setup, Pydantic 2.x validation, and functional programming.
This repository groups together the Python work I completed across multiple modules, keeping everything in a single place with a consistent structure and a clearer portfolio presentation.
The goal of this repository is to document my progression in Python through small, focused modules that explore different areas of the language and its ecosystem.
The modules move from introductory exercises and core syntax to more advanced concepts such as:
- functions and standard input/output
- object-oriented programming
- exception handling
- collections and data processing
- file handling and streams
- polymorphism and inheritance
- imports, packages, and project organization
- abstract classes and interfaces
- virtual environments and dependency management
- data validation with Pydantic
- functional programming patterns
42-python-modules/
├── module_00/
├── module_01/
├── module_02/
├── module_03/
├── module_04/
├── module_05/
├── module_06/
├── module_07/
├── module_08/
├── module_09/
├── module_10/
├── LICENSE
└── README.md
Each module contains its own exercises, usually organized in ex0/, ex1/, etc., depending on the original subject structure.
| Module | Main topic | Summary |
|---|---|---|
module_00 |
Python introduction | Basic Python syntax, functions, input/output, arithmetic operations, conditionals, loops, recursion, and simple type hints. |
module_01 |
Object-oriented programming | Classes, attributes, instance methods, inheritance, encapsulation, and basic object management. |
module_02 |
Exceptions and error handling | try/except, custom exceptions, raise, finally, and integrating validation into small Python systems. |
module_03 |
Collections and data structures | Lists, tuples, sets, dictionaries, generators, and comprehensions applied to data-processing style exercises. |
module_04 |
File handling and streams | Reading, writing, stream handling, and robust error management for file-based workflows. |
module_05 |
Polymorphism and method overriding | Subtype polymorphism, inheritance hierarchies, and adapting behavior through method redefinition. |
module_06 |
Imports and package organization | __init__.py, absolute imports, package structure, import paths, and circular dependency handling. |
module_07 |
Abstract programming patterns | Abstract base classes, interfaces, multiple inheritance, and composition through a modular architecture. |
module_08 |
Environment setup and dependency management | Virtual environments, package management, dependency isolation, and environment configuration. |
module_09 |
Pydantic models and validation | Data validation with Pydantic 2.x, custom validation rules, nested models, and robust typed data handling. |
module_10 |
Functional programming | Lambda expressions, higher-order functions, closures, functools, decorators, and functional design patterns. |
Originally, these modules were developed separately as part of the learning process. This repository brings them together in a more coherent way so that the full Python journey can be viewed as a single progression rather than as disconnected exercises.
It also makes the repository easier to browse, compare, and maintain.
Across all modules, this repository includes practice with:
- Python syntax and control flow
- functions and recursion
- type hints
- classes and inheritance
- encapsulation and object state
- exception hierarchies and defensive programming
- lists, tuples, sets, dictionaries, and comprehensions
- generators and data transformation
- file input/output and streams
- package structure and imports
- abstract base classes and interfaces
- environment setup and dependency isolation
- data validation with Pydantic
- functional programming tools and decorators
These modules were developed as part of the 42 Madrid curriculum and are primarily intended for:
- learning
- practice
- reference
- portfolio presentation
Some modules are more introductory, while others are more architectural or tooling-focused. Together, they show a broad view of my Python learning path.
Each module follows its own subject rules and may include its own exercise layout, entry point, or execution method.
In general:
- enter the module directory you want to explore
- check the exercise folders and required file names
- run the corresponding Python file according to the subject structure
Example:
python3 module_00/ex0/ft_hello_garden.pyFor modules involving package imports or environment setup, execution may require running from a specific directory or using a virtual environment.
This repository is meant to reflect:
- consistency across multiple Python topics
- progression from beginner to more advanced concepts
- clean organization of learning materials
- a structured and maintainable way to present coursework
This project is licensed under the MIT License. See the LICENSE file for more details.