Python
Python copied to clipboard
Built a simple BankAccount class in Python to understand the basics of Object-Oriented Programming (OOP). 📌 Key concepts used: Class and Object Constructor (__init__) Encapsulation (private variable) Method for checking account balance This small project helped me strengthen my foundation in Python and OOP concepts. Learning step by step and enjoying the process 🚀 #Python #OOP #Programming #Learning #BeginnerProject #EngineeringStudent
class BankAccount: def init(self,account_number,balance): self.__account_number = account_number self.balance = balance
def check_balance(self):
print("your account number is : ",self.__account_number)
print("your available balance is :" ,self.balance)
b = BankAccount(281207,27000) b.check_balance()