This project is a Python class that simulates the functionality of an ATM using Object-Oriented Programming (OOP). It serves as a practical blueprint for creating individual bank account “objects” that can interact with each other. Key features include methods for deposit, withdraw, check_balance, and transfer between different account instances.
Click the badge below to run my project in Google Colab:
## object oriented programing
# Create a new class
class ATM:
# init = initialization (Create)
def __init__(self, name, balance, bank):
self.name = name
self.balance = balance
self.bank = bank
# method => Function which is only create for this class
def deposit(self, amt):
self.balance += amt
print(f"Your balance is {self.balance}")
def withdraw(self, amt):
if self.balance >= amt:
self.balance -= amt
print(f"Your balance is {self.balance}")
else:
print("Insufficient Funds")
def check_balance(self):
print(f"Your balance is {self.balance}")
def transfer(self, amt, other):
if self.balance >= amt:
self.balance -= amt
other.balance += amt
print(f"Your balance is {self.balance}")
else:
print("Insufficient Funds")