This repository documents my journey of learning Python through practical projects, exercises, and manual implementations of selected Python operations and concepts.
The main goal is deep understanding rather than quick solutions. By implementing common operations manually, I practice understanding the logic, algorithms, data structures, and behavior behind them instead of simply relying on built-in solutions.
The projects/ directory contains practical Python projects developed while learning and applying Python fundamentals.
A command-line calculator built to practice Python fundamentals, type parsing, and error handling.
It supports:
- Basic Operations: Addition, Subtraction, Multiplication, and Division.
- Additional Operations: Floor Division (
//), Modulo (%), Exponentiation (^), and Roots (sqrt). - Error Handling: Handles edge cases such as division by zero, invalid mathematical operations (e.g., 0 raised to a negative exponent), and invalid user input.
Note: The calculator uses its own command syntax for some operations. For example,
^is used as the exponentiation symbol in the user interface, even though Python itself uses**for exponentiation.
A command-line task management application developed as a practical Python project.
It is used to practice:
- In-memory data management and list manipulation.
- CRUD operations (Create, Read, Update, Delete) on Python lists.
- User input validation and command routing (using
match-case). - Working with custom library functions for sequence manipulation.
- Building a larger program from smaller, modular components.
A command-line Rock Paper Scissors game built to practice:
- User input handling and validation.
- Conditional logic and loop control.
- List indexing and iteration.
- Pseudo-random number generation using custom library functions.
- Tracking and updating game state (scores).
abobakr_tools is a custom Python library created primarily as a learning tool.
The library contains manually implemented functions that reproduce selected Python operations and concepts without directly using the corresponding built-in solution.
The purpose is not to create a better replacement for Python's built-ins, but to understand how similar operations can be implemented and what logic is involved.
This module contains the foundational functions for input handling, parsing, string manipulation, collection operations, iteration, random number generation, and other basic Python concepts.
Examples include:
-
Input Handling
read_integerread_floatread_non_numeric_string
-
Manual Parsing
string_to_integerstring_to_float
-
String Operations
trim_stringremove_spacesreverse_items
-
Basic Sequence Operations
get_sequence_length— counts items without usinglen().get_sequence_sum— calculates a sum without usingsum().generate_sequence— generates a list of numbers without usingrange().generate_bounded_range— generates a bounded sequence.
-
Collection Conversions
to_tupleto_listto_setto_dict
-
Dictionary and Iteration Operations
get_dict_pairs— recreates the basic behavior ofdict.items().get_indexed_items— recreates the basic behavior ofenumerate().
-
Set Operations
set_unionset_intersectionset_differenceset_symmetric_difference
-
Zipping Utilities
get_shortest_lengthzip_as_listzip_as_set
-
Random Number Generation
calculate_next_seedget_pseudo_random_int
-
Math Helpers
calculate_average
Note: Some functions intentionally reproduce functionality that already exists in Python. This is done strictly for educational purposes to understand the underlying mechanics, not for performance or production use.
This repository is primarily a record of my learning process.
The code prioritizes understanding and clarity of logic over performance, brevity, or following advanced Python conventions.
Instead of only learning how to use a function, I sometimes implement a simplified version myself to understand the logic behind it.
For example, implementing a function similar to len() helps me practice:
- Iteration.
- Counters.
- Return values.
- Working with different types of sequences and iterables.
- Thinking about how an operation can be performed step by step.
The same approach is used when recreating other Python operations such as range(), sum(), enumerate(), dict.items(), and zip().
Python provides concise and powerful syntax, but concise code can sometimes hide the underlying logic while learning.
During these exercises, I intentionally write more explicit code so that I can focus on understanding what is happening at each step.
This does not mean that manual implementations are better than Python's built-in functions. In real projects, the built-in and standard Python solutions should normally be preferred for performance and readability.
The library is gradually expanded as I learn new Python concepts and operations.
When I encounter an operation that I already understand well enough to recreate using the concepts I have learned, I may implement a simplified version of it manually.
More advanced operations may be postponed until I have learned the concepts required to implement them properly. This keeps the library connected to my actual learning progress rather than attempting to reproduce Python's functionality all at once.
abobakr_tools is a temporary learning tool.
Once I finish learning the Python fundamentals I am using this library to practice, I plan to stop actively developing the library and move toward writing normal, idiomatic Python code.
python-learning/
│
├── abobakr_tools_/ # Package development directory
│ ├── pyproject.toml # Package configuration
│ │
│ └── abobakr_tools/ # Actual Python package
│ ├── __init__.py # Package initialization
│ └── core.py # Core utilities and manual implementations
│
└── projects/
├── calculator.py
├── rock_paper_scissors.py
└── to_do_list.py