NetCinFly

📘 Introduction

The current image has no alternative text. The file name is: IMG_20251026_155554_edit_57780115287597-scaled.jpg

In this project, you’ll develop a Student Grades Analyzer in Python that can:

  • Store student names and their grades
  • Calculate averages
  • Identify top and lowest performers
  • Display useful statistics

This project helps you strengthen your skills with lists, dictionaries, loops, and data analysis logic.


🧠 Key Concepts Covered

ConceptDescription
Lists & DictionariesStore student names and grades efficiently.
LoopsIterate through data for calculations.
ConditionalsCompare grades and find top performers.
Data AnalysisCompute average, max, and min values.

🧰 What You’ll Need

  • Python 3 installed
  • Basic knowledge of loops, lists, and dictionaries
  • (Optional) Familiarity with CSV files for data import/export

💻 Step-by-Step Code

File Name: grades_analyzer.py

# 🎓 Student Grades Analyzer

def add_student(students):
    name = input("Enter student name: ")
    grades = input("Enter grades separated by commas: ")
    grade_list = [float(g.strip()) for g in grades.split(",")]
    students[name] = grade_list
    print(f"✅ {name} added successfully!\n")

def calculate_average(grades):
    return sum(grades) / len(grades)

def show_statistics(students):
    print("\n📊 Class Statistics:\n")
    averages = {name: calculate_average(grades) for name, grades in students.items()}

    for name, avg in averages.items():
        print(f"{name}: {avg:.2f}")

    top_student = max(averages, key=averages.get)
    lowest_student = min(averages, key=averages.get)
    class_average = sum(averages.values()) / len(averages)

    print("\n🏅 Top Student:", top_student, f"({averages[top_student]:.2f})")
    print("📉 Lowest Student:", lowest_student, f"({averages[lowest_student]:.2f})")
    print(f"📘 Class Average: {class_average:.2f}\n")

def main():
    students = {}

    while True:
        print("🎓 Student Grades Analyzer")
        print("1. Add Student")
        print("2. View Statistics")
        print("3. Exit")

        choice = input("Choose an option (1-3): ")

        if choice == "1":
            add_student(students)
        elif choice == "2":
            if students:
                show_statistics(students)
            else:
                print("⚠️ No students added yet.\n")
        elif choice == "3":
            print("👋 Goodbye!")
            break
        else:
            print("❌ Invalid choice. Try again.\n")

if __name__ == "__main__":
    main()

🧩 Example Output

🎓 Student Grades Analyzer
1. Add Student
2. View Statistics
3. Exit
Choose an option (1-3): 1
Enter student name: Alice
Enter grades separated by commas: 90, 85, 88
✅ Alice added successfully!

🎓 Student Grades Analyzer
1. Add Student
2. View Statistics
3. Exit
Choose an option (1-3): 2

📊 Class Statistics:
Alice: 87.67

🏅 Top Student: Alice (87.67)
📉 Lowest Student: Alice (87.67)
📘 Class Average: 87.67

🚀 Bonus Improvements

  • Save and load student data from a CSV file using the csv module.
  • Add grading categories (tests, homework, projects).
  • Use Matplotlib to visualize grade distributions.
  • Create a GUI version using tkinter.

🧠 Summary

  • You built a Student Grades Analyzer that stores data dynamically.
  • You used loops, lists, and dictionaries to process and analyze information.
  • You learned how to calculate averages and generate performance insights.
⬇️ Download Netcinfly.apk تحميل Server 1

Related Posts

Eagle_Pro

🌐 Introduction In this project, you’ll create a Web Scraper App in Python that extracts quotes, authors, and tags from a live website.You’ll use the BeautifulSoup and Requests libraries to…

Read more

Cobra_Pro

🌦️ Introduction In this project, you’ll build a Weather App in Python that retrieves live weather information from an online API.You’ll learn how to work with HTTP requests, JSON data,…

Read more

Show7-Pro

Concepts Covered: 🎯 Objective: Create a simple, text-based contact book application that allows users to: 💡 Code (contact_book.py): 🧠 Example Usage Console Output Example: 💾 Notes ⬇️ Download Show7-Pro تحميل…

Read more

Rapid_tv

🔹 Introduction The Rock, Paper, Scissors Game is a classic hand game that you can easily build in Python. 👉 Rules: 🔹 Code Example 🔹 Example Run 🔹 Concepts Learned…

Read more

VOD-ZalHD

🔹 Introduction The Number Guessing Game is a classic beginner Python project. 🔹 Code Example 🔹 Example Run 🔹 Concepts Learned 🔹 Summary ⬇️ Download VOD-ZalHD تحميل Server 1 ⬇️…

Read more

Delux_pro

🔹 Introduction The To-Do List App is one of the most popular beginner projects. It teaches you how to: 🔹 Code Example 🔹 Features of This App 🔹 Example Run…

Read more