Reject Wrong Value Dry Run in PYTHON

Reject Wrong Value 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.

Reject Wrong Value Program Code

class Student:
    def __init__(self):
        self.__marks = 50

    def set_marks(self, marks):
        if marks >= 0 and marks <= 100:
            self.__marks = marks
        else:
            print("Invalid marks")


s1 = Student()
s1.set_marks(130)

View the complete Encapsulation programs page.

Program Console Reject Wrong Value Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.