Program Console Vignaankosh.com
Execution Panel
Console is empty.
Check Armstrong number (Narcissistic number) is an interactive PYTHON dry run visualizer from the While 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.
# Armstrong number: sum of cubes of digits equals number
num = int(input("Enter a number: "))
original = num
sum_cubes = 0
temp = num
# Count digits
count = 0
while temp > 0:
count += 1
temp //= 10
# Calculate sum of digits raised to power count
temp = num
while temp > 0:
digit = temp % 10
sum_cubes += digit ** count
temp //= 10
if original == sum_cubes:
print(f"{original} is an Armstrong number")
else:
print(f"{original} is NOT an Armstrong number")