ANCHAU
MY PYTHON PROJECT.
This is a banking system prototyp – and it used to deposit, withdraw and checking of balance. And the code was
there below;
class BankAccount:
def __init__(self, name, balance=0):
[Link] = name
[Link] = balance
# bank deposit
def deposit(self, amount):
if amount > 0:
[Link] += amount
print(f"you deposited #{amount}.\nNew balance is:
#{[Link]}")
else:
print("INVALID DEPOSIT AMOUNT")
# bank withdrawal
def withdraw(self, amount):
if amount > [Link]:
print("insufficient balance")
elif amount <= 0:
print("invalid withdrawal amount")
else:
[Link] -= amount
print(f"#{amount} withdrawn.\n New Balance Is: #{[Link]}")
def check_balance(self):
print(f"{[Link]}'s current balance is: #{[Link]}")
# Main Execution___________ANCHAU________________________________________)
for i in range(2):
print("Welcome to python Bank")
name = input("please enter your name: ")
account = BankAccount(name)
password = input("enter your password: ")
code = '4321'
i = i+1
# user details______________ANCHAU________________________________________)
if i == 2:
print(f"\nyou are a criminal\nyou enter {i} times wrong password")
if password == code:
break
1|P a g e
ANCHAU
while password == code:
print(f"welcome {name}")
print("\n1. deposit\n2. withdrawal\n3. check balance\n4. exit")
option = input("please enter option (1-4) :")
if option == "1":
amount = float(input("enter amount to deposit:"))
[Link](amount)
elif option == "2":
amount = float(input("Enter amount to withdraw: "))
[Link](amount)
elif option == "3":
account.check_balance()
elif option == "4":
print("thank you for using Anchau Bank")
else:
print("\nINVALID INPUT\nplease try again")
Wishs you success in all your endeavors.
2|P a g e