Python 進階 20:綜合專題 — 學生成績管理系統

🎯 學習目標

1. 綜合使用 list、dict、函式
2. 使用迴圈與條件判斷

📘 知識說明

專題需求:
- 存學生資料
- 計算平均分數

💻 範例程式
students = [
    {"name": "Amy", "score": 90},
    {"name": "John", "score": 80}
]

# 印出學生
for s in students:
    print(s["name"], s["score"])

# 計算平均
total = 0
for s in students:
    total += s["score"]

avg = total / len(students)
print("平均分數:", avg)
📝 練習任務 ▼

1. 新增一位學生資料
2. 修改某位學生分數
3. 計算所有學生平均分數
4. 嘗試排序學生分數

📌 小結 ▼

✔ 綜合使用 list、dict、函式
✔ 使用迴圈與條件

程式編輯器
程式輸出