Skip to content

Repository Structure

Quadstronaut edited this page Jun 11, 2026 · 2 revisions

Repository Structure

Every file is self-contained and runnable with a standard Python 3 install, except Mathmatical/factorial/factorial_numpy_module.py which requires pip install numpy.

PunyPython/
│
├── LearnXinY/                         ← Core language reference
│   ├── Primitives/
│   │   ├── numbers.py                 — integers, floats, arithmetic, operator precedence
│   │   ├── strings.py                 — creation, slicing, methods, f-strings, translate
│   │   └── booleans_and_none.py       — bool ops, comparisons, short-circuit, truthiness
│   │
│   ├── Variables/
│   │   └── assignment.py              — basic assignment, unpacking, swap, augmented, annotations
│   │
│   ├── Collections/
│   │   ├── lists.py                   — creation, indexing, slicing, mutation, methods
│   │   ├── tuples.py                  — immutability, unpacking, namedtuple, memory
│   │   ├── dictionaries.py            — access, views, mutation, merge, Counter, defaultdict
│   │   └── sets.py                    — operations, algebra, frozenset, deduplication
│   │
│   ├── ControlFlow/
│   │   ├── conditionals.py            — if/elif/else, ternary, match/case, guard clauses
│   │   ├── loops.py                   — for, while, range, enumerate, zip, break/continue/else
│   │   ├── exceptions.py              — try/except/else/finally, raise, custom exceptions, with
│   │   └── comprehensions.py          — list, set, dict comprehensions; generator expressions
│   │
│   ├── Functions/
│   │   ├── basics.py                  — def, return, scope, first-class, map/filter, lru_cache
│   │   ├── args_and_kwargs.py         — *args, **kwargs, keyword-only, positional-only, unpacking
│   │   ├── closures_and_lambdas.py    — closures, nonlocal, lambda, operator module
│   │   ├── decorators.py              — @decorator, @wraps, arguments, stacking, class decorators
│   │   └── generators.py              — yield, generator expressions, yield from, send, pipelines
│   │
│   ├── Modules/
│   │   └── imports.py                 — import, from/import, aliases, stdlib highlights, __name__
│   │
│   └── Classes/
│       ├── basics.py                  — class, __init__, instance attrs, __str__/__repr__, dataclass
│       ├── properties_and_statics.py  — @property, @classmethod, @staticmethod, cached_property
│       ├── inheritance.py             — single/multiple inheritance, super(), MRO, ABC, mixins
│       └── magic_methods.py           — arithmetic, comparison, container, context manager, __call__
│
├── Arrays/
│   ├── largest_element/               — 6 approaches to finding the largest element
│   │   ├── largest_element_lambda.py
│   │   ├── largest_element_max_func.py
│   │   ├── largest_element_native.py
│   │   ├── largest_element_operator_module.py
│   │   ├── largest_element_reduce_func.py
│   │   └── largest_element_sort_func.py
│   ├── rotate/                        — 5 approaches to left-rotating an array
│   │   ├── rotate_array_4_juggling_algorithm.py
│   │   ├── rotate_array_list_slicing.py
│   │   ├── rotate_array_native.py
│   │   ├── rotate_array_w_temp_array.py
│   │   └── rotate_one_by_one.py
│   └── sum_of_array/                  — 5 approaches to summing an array
│       ├── sum_of_array.py
│       ├── sum_of_array_divide_n_conquer.py
│       ├── sum_of_array_enumerate_func.py
│       ├── sum_of_array_reduce_module.py
│       └── sum_of_array_sum_func.py
│
├── Lists/
│   └── swap_first_last/               — 4 approaches to swapping first and last elements
│       ├── list_swap_2_w_slicing.py
│       ├── list_swap_2_w_star_operand.py
│       ├── list_swap_2_w_temp_var.py
│       └── list_swap_2_w_tuples.py
│
├── Mathmatical/
│   ├── Armstrong_number_check.py      — check if a number equals the sum of its digits each raised to the power of the number of digits
│   ├── add_2_numbers/                 — 6 approaches (inline, function, lambda, recursive, input(), operator module)
│   ├── factorial/                     — 4 approaches (math module, numpy*, recursive, prime-factorization path)
│   └── maximum_of_2_numbers/          — 6 approaches (if/else-in-function, max() builtin, ternary, lambda, sort, list_comprehension)
│
├── Textual/
│   ├── hello_world.py                 — print("Hello World")
│   ├── ascii_value_of_char.py         — print ASCII ordinal value of each character in user input
│   └── remove_nth_char.py             — remove the character at index n from a string (0-based)
│
└── venv_manager.py                    — CLI tool: list / create / delete Python virtual environments

* factorial_numpy_module.py requires pip install numpy — it is the only file in this repo with a third-party dependency.

Notes on naming

  • Mathmatical/ — the directory name is a typo of "Mathematical"; retained as-is to avoid breaking any existing references.
  • rotate_array_4_juggling_algorithm.py — "4" is part of the algorithm's conventional name (juggling / cycle-leader algorithm), not a sequence number.

Clone this wiki locally