Check if a number is palindrome Dry Run in PYTHON

Check if a number is palindrome is an interactive PYTHON dry run visualizer from the For 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.

Check if a number is palindrome Program Code

# Palindrome number: 121 reads same forwards and backwards
num = int(input("Enter a number: "))

# Convert to string and compare with reverse
num_str = str(num)
is_palindrome = num_str == num_str[::-1]

if is_palindrome:
    print(f"{num} is a palindrome number")
else:
    print(f"{num} is NOT a palindrome number")

View the complete For programs page.

Program Console Check if a number is palindrome Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.