So I made a code in oop where it would allow you to deposit money in a bank, and also withdraw it. I solved the part where I was able to deposit money but I'm not able to withdraw money from the bank. I would appreciate a fixed answer. Thanks!
class Bank:
def __init__(self,name,accountNumber,totalBalance):
self.name = name
self.accountNumber = {}
self.totalBalance = {}
def deposit(self):
print("What is your account number?")
x = input()
print("What balance are you depositing?")
y = input()
self.accountNumber[x] = y
print(self.accountNumber)
def withdraw(self):
print("What is your account number?")
s = int(input())
print("What balance are you withdrawing?")
f = int(input())
self.accountNumber[s] = self.accountNumber[s] - f
print(self.accountNumber)
Bank1 = Bank("MONEYYYYY",1234,53)
Bank1.deposit()
Bank1.withdraw()
If you know why it's not working then I would appreciate it if you could tell me why and fix it, thanks!