Skip to content · ⁨Saltar al contenido⁩

Bank account · ⁨Cuenta bancaria⁩

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.

Español

Cuenta bancaria

Un pequeño banco que sigue una lista de instrucciones y nunca permite que el saldo baje de cero.

"deposit 50".split() divide la cadena en sus espacios para obtener ["deposit", "50"]. La cantidad sigue siendo texto, así que conviértela con int(). Verifica si hay suficiente dinero antes de que un retiro modifique el saldo; un retiro rechazado simplemente no hace nada.

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP