Count odd numbers in list Dry Run in PYTHON

Count odd 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.

Count odd numbers in list Program Code

# Count odd numbers in list
data = [15, 22, 37, 44, 51, 68, 73, 86, 99]
print("List:", data)

odd_count = 0
odd_numbers = []

for num in data:
    if num % 2 != 0:  # or num % 2 == 1
        odd_count += 1
        odd_numbers.append(num)

print(f"Total odd numbers: {odd_count}")
print(f"Odd numbers list: {odd_numbers}")
print(f"Even numbers count: {len(data) - odd_count}")

View the complete Lists programs page.

Program Console Count odd numbers in list Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.