Convert String to Uppercase Dry Run in PYTHON

Convert String to Uppercase 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.

Convert String to Uppercase Program Code

# Python program to convert string to uppercase
text = "Hello World!"

# Method 1: Using built-in upper() method
uppercase1 = text.upper()

# Method 2: Manual conversion using ASCII
uppercase2 = ""
for char in text:
    if 'a' <= char <= 'z':
        # Convert to uppercase using ASCII (subtract 32)
        uppercase2 = uppercase2 + chr(ord(char) - 32)
    else:
        uppercase2 = uppercase2 + char

print("Original:", text)
print("Built-in upper():", uppercase1)
print("Manual conversion:", uppercase2)

View the complete Strings programs page.

Program Console Convert String to Uppercase Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.