An open API service indexing awesome lists of open source software.

https://github.com/german-boop/student-grades-ranking

Rank students by grades in descending order using Python; beginner-friendly and PEP 8 compliant.
https://github.com/german-boop/student-grades-ranking

beginner-friendly dictionary first-pull-request first-timers hacktoberfest learning python sorting

Last synced: 8 days ago
JSON representation

Rank students by grades in descending order using Python; beginner-friendly and PEP 8 compliant.

Awesome Lists containing this project

README

          

# Student-Grades-Ranking
Rank students by grades in descending order using Python; beginner-friendly and PEP 8 compliant.
# 🎓 Student Grades Ranking

A simple and beginner-friendly Python script to **rank students based on their grades**.
This project demonstrates the use of:

- Python dictionaries for storing student names and grades
- Sorting by dictionary values in descending order
- Enumerate to print rankings
- Clean and readable code following PEP 8 standards

Perfect for Python learners who want to practice basic data structures, sorting, and formatted output.

# 🎓 Student Grades Ranking

![Python](https://img.shields.io/badge/Python-3.12-blue)
![First Timers Friendly](https://img.shields.io/badge/first--timers-friendly-brightgreen)
![License](https://img.shields.io/badge/License-MIT-blue)

A simple and beginner-friendly Python script to **rank students based on their grades**.
This project demonstrates:

- Python dictionaries for storing student names and grades
- Sorting by dictionary values in descending order
- Using `enumerate` to print rankings
- Clean and readable code following PEP 8 standards

Perfect for Python learners who want to practice **data structures, sorting, and formatted output**.

---

## 📂 Project Structure
# 🎓 Student Grades Ranking

![Python](https://img.shields.io/badge/Python-3.12-blue)
![First Timers Friendly](https://img.shields.io/badge/first--timers-friendly-brightgreen)
![License](https://img.shields.io/badge/License-MIT-blue)

A simple and beginner-friendly Python script to **rank students based on their grades**.
This project demonstrates:

- Python dictionaries for storing student names and grades
- Sorting by dictionary values in descending order
- Using `enumerate` to print rankings
- Clean and readable code following PEP 8 standards

Perfect for Python learners who want to practice **data structures, sorting, and formatted output**.

---

## 📂 Project Structure
├── 📄 main.py
├── 📄 README.md
├── 📄 LICENSE
└── 📄 .gitignore

- `main.py` → Python script to rank students
- `README.md` → Project documentation
- `LICENSE` → MIT License file
- `.gitignore` → Ignore unnecessary files (e.g., `__pycache__`)

---

## ✨ Features

- ✅ Stores student names and grades in a dictionary
- ✅ Sorts students by grade in descending order
- ✅ Prints students with ranking using `enumerate`
- ✅ Beginner-friendly and easy to extend

---

## 🚀 Quick Start

### 1. Clone the repository
```bash
git clone https://github.com/username/student_grades.git
cd student_grades

# Dictionary with student grades
students = {
"Ali": 18,
"Sara": 20,
"Reza": 16,
"John": 19
}

# Sort students by grade in descending order
sorted_students = sorted(students.items(), key=lambda item: item[1], reverse=True)

# Print students with ranking
print("Ranking of students by grade:")
for rank, (name, grade) in enumerate(sorted_students, start=1):
print(f"{rank}. {name}: {grade}")

🖼 Example Output
Ranking of students by grade:
1. Sara: 20
2. John: 19
3. Ali: 18
4. Reza: 16