============================================================
 GENERATORS & LAZY EVALUATION - Demo Run
============================================================

--- count_up generator (rewritten from CountUp class) ---
  [1, 2, 3, 4, 5]

--- fibonacci_gen ---
  [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

--- Infinite generator, safely consuming only first 10 ---
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

--- Memory-efficient file reading ---
  read: line 0
  read: line 1
  read: line 2
  read: line 3
  read: line 4
  (Only ONE line is ever in memory at a time -- scales to files far larger than RAM.)

--- Filter+transform generator vs. comprehension ---
  Generator function result: [4, 16, 36, 64, 100]
  Comprehension result:      [4, 16, 36, 64, 100]
  Match: True

--- Single-use demonstration ---
  First loop over generator:  [1, 2, 3]
  Second loop (exhausted):    []  <- empty, confirming single-use

--- yield from chaining ---
  [1, 2, 3, 10, 11, 12]

============================================================
 Assignment: paginate + flatten_pages (compose to reconstruct original)
============================================================
  Original: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  Paginated (size 4): [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
  Reconstructed via flatten_pages: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  Matches original: True
