Program Console Vignaankosh.com
Execution Panel
Console is empty.
Count positive and negative numbers (stop at 0) 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.
# Count positive and negative numbers
pos_count = 0
neg_count = 0
num = int(input("Enter a number (0 to stop): "))
while num != 0:
if num > 0:
pos_count += 1
else:
neg_count += 1
num = int(input("Enter another number (0 to stop): "))
print(f"Positive numbers: {pos_count}")
print(f"Negative numbers: {neg_count}")