Program to compare two numbers Dry Run in PYTHON

Program to compare two numbers is an interactive PYTHON dry run visualizer from the Io 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.

Program to compare two numbers Program Code

# Program to compare two numbers
a = float(input("Enter first number: "))
b = float(input("Enter second number: "))

if a > b:
    print(f"{a} is greater than {b}")
elif a < b:
    print(f"{a} is less than {b}")
else:
    print(f"{a} is equal to {b}")

View the complete Io programs page.

Program Console Program to compare two numbers Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.