Python Program to Create a Bank Account with Deposit, Withdraw Money
class Account: def_init_(self): self.balance=0 print('Your Account is Created.') def deposit(self): amount=int(input('Enter the amount to deposit:')) self.balance+=amount print('Your New Balance =%d' %self.balance) def withdraw(self): amount=int(input('Enter the amount to withdraw:')) if(amount>self.balance): print('Insufficient Balance!') else: self.balance-=amount print('Your Remaining Balance =%d' %self.balance) def enquiry(self): print('Your Balance =%d' %self.balance) account= Account() account.deposit() account.withdraw() account.enquiry()
Output:
Your Account is Created. Enter the amount to deposit: 5000 Your New Balance = 5000 Enter the amount to withdraw: 2000 Your Remaining Balance = 3000 Your Balance = 3000