Find sum and average of dictionary values Dry Run in PYTHON

Find sum and average of dictionary values is an interactive PYTHON dry run visualizer from the Dict 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.

Find sum and average of dictionary values Program Code

# Find sum and average of dictionary values
data = {"Math": 85, "Science": 90, "English": 78, "History": 92, "Art": 80}
print("Dictionary:", data)

# Sum using sum() on values
total = sum(data.values())
print(f"Sum: {total}")

# Average = Sum / Count
average = total / len(data)
print(f"Average: {average}")

# Manual sum
manual_sum = 0
for value in data.values():
    manual_sum += value
print(f"Manual sum: {manual_sum}")
 

View the complete Dict programs page.

Program Console Find sum and average of dictionary values Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.