Title: Implement iterative fib(n) in doiter_bfo/skeleton.py (1-based indexing)
Description:
We need a new function fib(n) implemented in doiter_bfo/skeleton.py with 1-based indexing. The function must satisfy the following requirements:
Signature: fib(n) accepts a single integer n.
Input validation: raise an AssertionError when n is not a positive integer. Implement this using an assert statement, e.g., assert isinstance(n, int) and n > 0. Specifically, fib(-10) must trigger AssertionError.
Fibonacci definition (1-based indexing):
fib(1) = 1
fib(2) = 1
For n > 2, fib(n) = fib(n-1) + fib(n-2)
Implementation: iterative (O(n) time, O(1) extra space) to avoid recursion.
Side effects: Do not print or produce side effects; the function should return the computed value only.
Documentation: Provide a concise docstring explaining usage and behavior.
Accessibility: Ensure the function is accessible as doiter_bfo.skeleton.fib so the existing tests can call fib(1), fib(2), fib(7), and fib(-10).
Steps to Reproduce / Verification:
Run the test suite (e.g., pytest) after implementing fib.