Compare Strings Dry Run in PYTHON

Compare Strings is an interactive PYTHON dry run visualizer from the Strings 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.

Compare Strings Program Code

# Python program to compare strings
str1 = "hello"
str2 = "hello"
str3 = "HELLO"

# Case-sensitive comparison
if str1 == str2:
    print("'hello' and 'hello' are EQUAL (case-sensitive)")

# Case-insensitive comparison
if str1.lower() == str3.lower():
    print("'hello' and 'HELLO' are EQUAL (case-insensitive)")

# Lexicographic comparison
print("'apple' < 'banana':", 'apple' < 'banana')
print("'Python' > 'Java':", 'Python' > 'Java')

View the complete Strings programs page.

Program Console Compare Strings Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.