Public and Private Data Dry Run in PYTHON

Public and Private Data is an interactive PYTHON dry run visualizer from the Encapsulation programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Public and Private Data Program Code

class BankAccount:
    def __init__(self):
        self.owner = "Ravi"
        self.__balance = 5000


account = BankAccount()
print(account.owner)
print(account._BankAccount__balance)

View the complete Encapsulation programs page.

Program Console Public and Private Data Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.