Created
November 15, 2024 03:43
-
-
Save timcsy/6638bbc645b671e49bc2163fe8031cfc to your computer and use it in GitHub Desktop.
grade.py 練習提示
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 定義一個計算成績等第的 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