Python icon indicating copy to clipboard operation
Python copied to clipboard

🚀 Learning Python – Object-Oriented Programming (OOP) Today I practiced a simple BankAccount class in Python using OOP concepts. 🔑 Concepts used: Class and Object Constructor (__init__) Encapsulation (private variable __account_number) Methods This helped me understand how real-world objects like a bank account can be modeled using Python. Excited to keep learning and improving my Python skills! 💻🐍 #Python #OOP #LearningPython #Programming #Beginner #AIML #Student

Open ayyanagoud12 opened this issue 1 month ago • 0 comments

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()

ayyanagoud12 avatar Dec 16 '25 17:12 ayyanagoud12