write a python program to Create a class to handle Bank transactions and display the transaction details.
Answers
Answer:
# BankAccount class
class Bankaccount: # Function to deposite amount
def deposit(self):
amount = float(input("Enter amount to be deposited: "))
self.balance += amount
print("\n Amount Deposited:", amount)
def __init__(self):
# Function to withdraw the amount
def withdraw(self):
amount = float(input("Enter amount to be withdrawn: "))
if self.balance >= amount:
self.balance -= amount
print("\n You Withdrew:", amount)
else:
print("\n Insufficient balance ")
# Functin to display the amount
def display(self):
print("\n Net Available Balance =", self.balance)
# Functin to display the amount
def display(self):
print("\n Net Available Balance =", self.balance)
Explanation: