1 notebook https://notebook.google.com/notebook/95b351c6-6b8c-42bf-8379-f4626ca70042 2 https://studio.youtube.com/video/rLmDbh3C-xo/edit 3. 學習卡 測驗 4. 🐍 Python 程式碼 ( score_checker.py ) def judge_score ( score , pass_standard = 60 ): """ 判斷成績是否及格並給予評語 :param score: 輸入的分數 (float/int) :param pass_standard: 及格標準,預設為 60 分 :return: (is_pass, comment) """ # 檢查分數是否在合理範圍內 if score < 0 or score > 100 : return None , "錯誤:分數必須介於 0 到 100 之間!" # 判斷是否及格 is_pass = score >= pass_standard # 根據分數給予評語 if score >= 90 : comment = "太棒了!表現非常優秀,請繼續保持!" elif is_pass: comment = "恭喜及格!代表你已經掌握了基本概念,繼續加油!" else : comment = "很遺憾未達及格標準。別氣餒,找出不懂的地方再接再厲!" ...
這個網誌中的熱門文章
1. notebooklm 學習卡 # 溫度轉換程式 # 讓使用者輸入攝氏溫度 celsius = float(input("請輸入攝氏溫度:")) # 將攝氏轉換成華氏 fahrenheit = celsius * 9 / 5 + 32 # 顯示結果 print("華氏溫度是:", fahrenheit) 如果要做「雙向轉換」 # 溫度轉換程式:攝氏 ↔ 華氏 choice = input("請選擇轉換方向(C 轉 F / F 轉 C):") if choice.upper() == "C": # 攝氏轉華氏 celsius = float(input("請輸入攝氏溫度:")) fahrenheit = celsius * 9 / 5 + 32 print("華氏溫度:", fahrenheit) elif choice.upper() == "F": # 華氏轉攝氏 fahrenheit = float(input("請輸入華氏溫度:")) celsius = (fahrenheit - 32) * 5 / 9 print("攝氏溫度:", celsius) else: # 使用者輸入錯誤 print("輸入錯誤,請輸入 C 或 F。") 心得: 使用 Python Tutor 後,我更容易理解程式執行的過程,也能清楚看到每一步變化,讓我學習 Python 變得更加簡單有趣


















留言
張貼留言