Comprehensive dictionary review program Dry Run in PYTHON

Comprehensive dictionary review program 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.

Comprehensive dictionary review program Program Code

# Comprehensive: Student Grade Analysis System
students = {
    "Alice": 85, "Bob": 92, "Charlie": 78, "David": 96,
    "Eva": 88, "Frank": 75, "Grace": 91, "Henry": 82
}
print("Student Grades:", students)

# 1. Statistics
total = sum(students.values())
average = total / len(students)
print(f"\n Statistics:")
print(f"  Total students: {len(students)}")
print(f"  Sum of grades: {total}")
print(f"  Average grade: {average:.2f}")

# 2. Top and Bottom
top_student = max(students, key=students.get)
bottom_student = min(students, key=students.get)
print(f"\n Top Student: {top_student} ({students[top_student]})")
print(f" Bottom Student: {bottom_student} ({students[bottom_student]})")

# 3. Grade Distribution
grade_ranges = {"A": [], "B": [], "C": [], "D": [], "F": []}
for name, score in students.items():
    if score >= 90: grade_ranges["A"].append(name)
    elif score >= 80: grade_ranges["B"].append(name)
    elif score >= 70: grade_ranges["C"].append(name)
    elif score >= 60: grade_ranges["D"].append(name)
    else: grade_ranges["F"].append(name)

print(f"\n Grade Distribution:")
for grade, names in grade_ranges.items():
    if names:
        print(f"  {grade}: {len(names)} student(s) - {names}")

# 4. Above and Below Average
above_avg = {n: s for n, s in students.items() if s > average}
below_avg = {n: s for n, s in students.items() if s < average}
print(f"\n⬆ Above Average ({len(above_avg)}): {above_avg}")
print(f"⬇ Below Average ({len(below_avg)}): {below_avg}")

# 5. Sorted by score
sorted_by_score = dict(sorted(students.items(), key=lambda x: x[1], reverse=True))
print(f"\n Ranked Students:")
for rank, (name, score) in enumerate(sorted_by_score.items(), 1):
    print(f"  {rank}. {name}: {score}")

View the complete Dict programs page.

Program Console Comprehensive dictionary review program Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.