Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find positive and negative numbers in list is an interactive PYTHON dry run visualizer from the Lists 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.
# Separate positive and negative numbers
numbers = [15, -3, 28, -7, 0, -12, 45, -9, 33, -21, 10]
print("Original list:", numbers)
positives = []
negatives = []
zeros = 0
for num in numbers:
if num > 0:
positives.append(num)
elif num < 0:
negatives.append(num)
else:
zeros += 1
print(f"\nPositive numbers ({len(positives)}): {positives}")
print(f"Negative numbers ({len(negatives)}): {negatives}")
print(f"Zeros: {zeros}")