Program Console Vignaankosh.com
Execution Panel
Console is empty.
Check if number is perfect 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.
# Perfect number = sum of proper divisors equals the number
num = int(input("Enter a number: "))
sum_divisors = 0
i = 1
while i <= num // 2:
if num % i == 0:
sum_divisors += i
i += 1
if sum_divisors == num and num > 0:
print(f"{num} is a perfect number")
else:
print(f"{num} is NOT a perfect number")