Skip to content

Instantly share code, notes, and snippets.

@timcsy
Created November 15, 2024 03:43
Show Gist options
  • Save timcsy/6638bbc645b671e49bc2163fe8031cfc to your computer and use it in GitHub Desktop.
Save timcsy/6638bbc645b671e49bc2163fe8031cfc to your computer and use it in GitHub Desktop.
grade.py 練習提示
# 定義一個計算成績等第的 function
def show_grade(student_name, student_score):
# 完成 show_grade 函數
# 使用 function 處理每位學生
students = [
{"name": "Alice", "score": 85},
{"name": "Bob", "score": 72},
{"name": "Charlie", "score": 67},
{"name": "Diana", "score": 93}
]
# 輸出結果
for student in students:
show_grade(student['name'], student["score"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment