filmov
tv
Create a simple ATM app using Python

Показать описание
In this video we are going to create a simple ATM application with Python.
We first declare the 'balance' variable and assign it the amount of cash. Then, we define 'ATM' function that has four choices (check, withdraw, deposit, and transfer).
The 5th choice is to exit the application. If the user choose a number larger than 5, an alarm message will appear.
1. check function will return the current balance.
2. withdraw function will return the current balance amount after deducting from it the entered amount of cash only if the cash is smaller or equal to the current balance, else it will return 'Non-Sufficient funds!' message.
3. deposit function will return the current balance amount after adding to it the entered amount of cash by a user.
4. transfer function will return the current balance amount after deducting from it the entered amount of cash only if the cash is smaller or equal to the current balance, else it will return 'Non-Sufficient funds!' message.
Finally we call the ATM() function.
We first declare the 'balance' variable and assign it the amount of cash. Then, we define 'ATM' function that has four choices (check, withdraw, deposit, and transfer).
The 5th choice is to exit the application. If the user choose a number larger than 5, an alarm message will appear.
1. check function will return the current balance.
2. withdraw function will return the current balance amount after deducting from it the entered amount of cash only if the cash is smaller or equal to the current balance, else it will return 'Non-Sufficient funds!' message.
3. deposit function will return the current balance amount after adding to it the entered amount of cash by a user.
4. transfer function will return the current balance amount after deducting from it the entered amount of cash only if the cash is smaller or equal to the current balance, else it will return 'Non-Sufficient funds!' message.
Finally we call the ATM() function.