Program Console Vignaankosh.com
Execution Panel
Console is empty.
Count odd numbers in tuple is an interactive PYTHON dry run visualizer from the Tuples 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 tuple
numbers = (15, 8, 33, 42, 29, 14, 7, 68, 55, 24, 39)
print("Tuple:", numbers)
odd_count = 0
odd_list = []
for num in numbers:
if num % 2 != 0: # or num % 2 == 1
odd_count += 1
odd_list.append(num)
print(f"Odd numbers count: {odd_count}")
print(f"Odd numbers: {odd_list}")
# Using sum comprehension
odd_count_comp = sum(1 for num in numbers if num % 2 != 0)
print(f"Using comprehension: {odd_count_comp}")