Program Console Vignaankosh.com
Execution Panel
Console is empty.
Reverse a String 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.
# Python program to reverse a string
original = "abcdef"
# Method 1: Using slicing (most Pythonic)
reversed1 = original[::-1]
# Method 2: Using reversed() and join()
reversed2 = ''.join(reversed(original))
# Method 3: Using a loop
reversed3 = ''
for char in original:
reversed3 = char + reversed3
print("Original string:", original)
print("Reversed (slicing):", reversed1)
print("Reversed (reversed()):", reversed2)
print("Reversed (loop):", reversed3)