Program Console Vignaankosh.com
Execution Panel
Console is empty.
Student Grade Manager System is an interactive PYTHON dry run visualizer from the While 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.
# Student grade manager with while loop
students = []
total_students = int(input("Enter number of students: "))
i = 1
print("\n--- ENTER STUDENT DETAILS ---")
while i <= total_students:
print(f"\nStudent {i}:")
name = input(" Name: ")
# Validate marks input
while True:
try:
marks = float(input(" Marks (0-100): "))
if 0 <= marks <= 100:
break
else:
print(" Marks must be between 0 and 100!")
except ValueError:
print(" Invalid input! Please enter a number.")
# Determine grade
if marks >= 90:
grade = 'A+'
elif marks >= 80:
grade = 'A'
elif marks >= 70:
grade = 'B'
elif marks >= 60:
grade = 'C'
elif marks >= 50:
grade = 'D'
else:
grade = 'F'
students.append({"name": name, "marks": marks, "grade": grade})
i += 1
# Display report
print("\n" + "="*50)
print("STUDENT GRADE REPORT")
print("="*50)
print(f"{'Name':<20} {'Marks':<10} {'Grade':<10}")
print("-"*50)
total_marks = 0
i = 0
while i < len(students):
student = students[i]
print(f"{student['name']:<20} {student['marks']:<10.2f} {student['grade']:<10}")
total_marks += student['marks']
i += 1
print("-"*50)
average = total_marks / total_students
print(f"{'AVERAGE':<20} {average:<10.2f}")
# Grade distribution
print("\n--- GRADE DISTRIBUTION ---")
grade_counts = {'A+':0, 'A':0, 'B':0, 'C':0, 'D':0, 'F':0}
i = 0
while i < len(students):
grade_counts[students[i]['grade']] += 1
i += 1
for grade, count in grade_counts.items():
if count > 0:
print(f"{grade}: {count} student(s)")