Skip to content · ⁨コンテンツへスキップ⁩

Bank account · ⁨銀行口座⁩

English

Bank account

A tiny bank that follows a list of instructions and never lets the balance go below zero.

"deposit 50".split() breaks the string at its spaces into ["deposit", "50"]. The amount is still text, so convert it with int(). Check that there is enough money before a withdrawal changes the balance; a refused withdrawal simply does nothing.

日本語

バンク口座

指示リストに従って動作し、残高がゼロを下回らないようにする小さな銀行です。

"deposit 50".split() はスペースで文字列を ["deposit", "50"] に分割します。金額は依然としてテキストなので、int() で変換してください。引き出し操作によって残高が変わる前に、資金が十分か確認します。拒否された引き出しは何も行いません。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP