Program Console Vignaankosh.com
Execution Panel
Console is empty.
While-else clause demonstration 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.
# While-else executes else when loop completes normally
num = int(input("Enter a number to find factors: "))
i = 2
found = False
while i <= num // 2:
if num % i == 0:
print(f"{num} is divisible by {i}")
found = True
break
i += 1
else:
print(f"{num} is a prime number!")
if found:
print(f"{num} is composite (not prime)")