Constructor Calling Same Class Method Dry Run in PYTHON

Constructor Calling Same Class Method is an interactive PYTHON dry run visualizer from the Constructors 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.

Constructor Calling Same Class Method Program Code

class Result:
    def __init__(self, name, marks):
        self.name = name
        self.marks = marks
        self.grade = self.find_grade()

    def find_grade(self):
        if self.marks >= 80:
            return "A"
        else:
            return "B"

r1 = Result("Kavya", 86)
print(r1.name)
print(r1.grade)

View the complete Constructors programs page.

Program Console Constructor Calling Same Class Method Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.