Function to check even or odd Dry Run in PYTHON

Function to check even or odd is an interactive PYTHON dry run visualizer from the Functions 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.

Function to check even or odd Program Code

def check_even_odd(n):
    """Return 'Even' or 'Odd' based on parity"""
    if n % 2 == 0:
        return "Even"
    else:
        return "Odd"

# Test with multiple values
num1, num2 = 17, 24
print(f"{num1} is {check_even_odd(num1)}")
print(f"{num2} is {check_even_odd(num2)}")

View the complete Functions programs page.

Program Console Function to check even or odd Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.