Welcome to the payments team. We are building the money-movement core of a small payments product. Its public API in bank/bank_system.py is agreed and stubbed out, and the rules are in README.md.
Welcome to the payments team. We are building the money-movement core of a small payments product. Its public API in bank/bank_system.py is agreed and stubbed out, and the rules are in README.md.
Build levels 1 and 2 below in 30 minutes. The checks are graded one by one, so every method you get working counts even if the rest is not done.
create_account opens an account with a balance of 0 and refuses an id that is already in use.deposit returns the new balance, or None for an unknown account.pay moves money between two different accounts at once and returns the source's new balance. It returns None and moves nothing when an account is unknown, both ids are the same, or the source holds less than the amount.get_balance returns the balance, or None for an unknown account.top_spenders(timestamp, n) lists up to n accounts as "account_id(total)", by money paid out, highest first.pytest tests/visible. The hidden checks call the same methods with longer sequences of calls.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
bank-system-accounts-payments-and-top-spenders
Changes under src/ are evaluated.