0% found this document useful (0 votes)
4 views4 pages

Banking System Project

The document describes a simple console-based banking system implemented in Python, featuring account creation, deposit, withdrawal, and balance inquiry functionalities. It includes a class definition for BankAccount with methods for managing account operations. The main function provides a user interface for interacting with the banking system through a menu-driven approach.

Uploaded by

mohdazhar925a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Banking System Project

The document describes a simple console-based banking system implemented in Python, featuring account creation, deposit, withdrawal, and balance inquiry functionalities. It includes a class definition for BankAccount with methods for managing account operations. The main function provides a user interface for interacting with the banking system through a menu-driven approach.

Uploaded by

mohdazhar925a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Banking System in Python

This is a simple console-based banking system with the following features:

- Create Account

- Deposit

- Withdraw

- Balance Inquiry
class BankAccount:
def __init__(self, owner):
self.owner = owner
self.balance = 0.0

def deposit(self, amount):


if amount > 0:
self.balance += amount
print(f"Deposited: ${amount}")
else:
print("Deposit amount must be positive.")

def withdraw(self, amount):


if amount <= self.balance:
self.balance -= amount
print(f"Withdrew: ${amount}")
else:
print("Insufficient funds.")

def display_balance(self):
print(f"{self.owner}'s Balance: ${self.balance}")

def main():
print("Welcome to the Banking System")
name = input("Enter account holder name: ")
account = BankAccount(name)

while True:
print("\nOptions:")
print("1. Deposit")
print("2. Withdraw")
print("3. Balance Inquiry")
print("4. Exit")
choice = input("Choose an option: ")

if choice == '1':
amount = float(input("Enter amount to deposit: "))
account.deposit(amount)
elif choice == '2':
amount = float(input("Enter amount to withdraw: "))
account.withdraw(amount)
elif choice == '3':
account.display_balance()
elif choice == '4':
print("Thank you for using our banking system.")
break
else:
print("Invalid choice. Please try again.")

if __name__ == "__main__":
main()
Use Case Diagram
Flowchart

You might also like