[EN] This script works as an interactive ATM cash dispenser. You can easyly edit the default configuration if you want to customize your own ATM.
It runs until the user chooses to exit by entering '0'. The system is limited by the amount of cash in inventory. It can be reused and customized by editing new denominations and available bills.
The user must manually enter a withdrawal amount, and the ATM will attempt to dispense the requested amount using the fewest number of bills possible, starting from the highest denomination. If the amount cannot be dispensed exactly, an error message will be shown.
Finally, if the available cash falls to $1000 or below, the system issues a low-cash warning.
Initial inventory: 10 bills of each denomination from $20 to $1000.
inventory = { 1000: 10, 500: 10, 200: 10, 100: 10, 50: 10, 20: 10}
Dispensing conditions: The requested amount must be greater than zero and divisible by 10.
if requested_amount <= 0 or requested_amount % 10 != 0:
Low cash warning condition: The ATM will display a warning message if the total available cash falls bellow or equal to $1000.
if total <= 1000:
This project is licensed under the MIT License.