A small collection of Python examples and exercises organized by concept and package. This repository groups learning material and code for Python basics, string operations, lists, tuples and dictionaries.
This index lists the learning packages and example files in this repository. Each package focuses on a core Python concept and contains small example scripts, exercises, and an explanatory README.
- basics — Basics: Core fundamentals — variables, data types, control flow (if/else), loops (for/while), functions, basic I/O.
- boolean-gates — Boolean Gates: Boolean logic, truth tables, and logical operators.
- data-handling — Data Handling: File I/O, CSV parsing, basic data transformations and common utilities.
- modules — Modules: Creating and using modules and packages, standard library highlights.
- flow-controls — Flow Controls: Conditional statements, loops, and exception handling patterns.
- string-manipulation — String Manipulation: String methods, formatting, slicing, and parsing patterns.
- list — Lists: Building and manipulating lists, comprehensions, nested lists, and common algorithms.
- tuples — Tuples: Immutable sequences, packing/unpacking, and tuple use-cases.
- dictionary — Dictionaries: Mapping types, creation patterns, dictionary methods, and nested structures.
- ethics — Ethics & Fundamentals: Intellectual property, plagiarism, open source philosophy, and societal impacts.
Below is a mermaid sequence diagram that represents how a learner might progress through the core concepts in this repository (Python Basic -> String -> List -> Tuple -> Dictionary).
sequenceDiagram
participant Learner as Learner
participant Basic as Python Basic
participant String as String
participant List as List
participant Tuple as Tuple
participant Dict as Dictionary
Learner->>Basic: Start with fundamentals (variables, types, control flow)
Basic->>String: Learn string creation and manipulation
String->>List: Convert and split strings into lists;
List->>Tuple: Understand immutability and when to use tuples
Tuple->>Dict: Use tuples as keys and migrate to mappings (dicts)
List->>Dict: Build dictionaries from list of pairs
String->>Dict: Parse key:value strings into dictionaries
note over Learner,Dict: Iterate, practice exercises, and refer to package readmes
- Browse the package folders and open the README or example scripts.
- Run example scripts locally using Python 3.x:
python3 path/to/example.py. - Each package contains focused explanations and sample code.
- Try small edits and rerun to learn by experimentation.
Contributions welcome — open issues and PRs to add examples, fixes or explanations.
- Add focused READMEs inside each package with short exercises and expected outputs.
- Add unit tests for examples (pytest) and a CI workflow to run them.
- Add more intermediate/advanced packages (file handling, modules, OOP, exceptions).