"""
Exercise 3: enforce a keyword-only, positional-only API shape

Implement divide(a, b, /, *, round_to=None) such that:

  - a and b MUST be passed positionally (calling divide(a=1, b=2) must
    raise TypeError — this happens automatically once you use `/`
    correctly in the signature, you don't need to check manually).
  - round_to MUST be passed by keyword if given at all.
  - Returns a / b, rounded to `round_to` decimal places if round_to is
    not None (use the builtin round()), else the raw float division.
  - Raises ZeroDivisionError naturally if b == 0 (no need to catch it,
    just don't guard against it — let the division raise).
"""

def divide(a, b, round_to=None):  # TODO: add the required / and * markers
    # TODO: implement per the docstring above.
    pass


# --- self-check: do not modify below this line ---
r1 = divide(7, 2)
r2 = divide(7, 2, round_to=1)

try:
    divide(a=7, b=2)
    positional_only_enforced = False
except TypeError:
    positional_only_enforced = True

try:
    divide(1, 0)
    zero_div_raised = False
except ZeroDivisionError:
    zero_div_raised = True

checks = [
    (r1, 3.5),
    (r2, 3.5),
    (positional_only_enforced, True),
    (zero_div_raised, True),
]

all_passed = all(actual == expected for actual, expected in checks)
for actual, expected in checks:
    print(f"got {actual!r}, expected {expected!r} -> {'PASS' if actual == expected else 'FAIL'}")

print("ALL PASS" if all_passed else "SOME FAILED")
