Python TQC考題206_等級判斷, if 條件1:動作1 elif 條件2:動作2, else: 動作n,==為邏輯判斷式,=為指定 by 儲蓄保險王 · 2022-04-27 #Python TQC考題206_等級判斷 score=eval(input()) if score >= 80: print(“A”) elif score >= 70: print(“B”) elif score >= 60: print(“C”) else: print(“F”) Spyder執行結果 相關文章Python pandas iterrows:為什麼你改 row 沒有效果?正確更新 DataFrame 的方法Python Zipfile 實戰:Write vs Writestr —— 硬碟搬運工與記憶體魔術師; XML 處理的世界裡,writestr 才是真正的主角; zf.writestr(zinfo_or_arcname, data) #zinfo_or_arcname: ZipInfo | str ; data: bytes | strPython Counter 速查與實戰指南;from collections import CounterPython 機器學習:手把手教你用 sklearn.preprocessing .StandardScaler 做數據標準化(Standardization)#只接受2D數據 ; from sklearn.preprocessing import StandardScaler ; 儲存/載入 scaler or model: joblib.dump() / joblib.load()Python × Ollama 教學:用本地 LLM (Large Language Model 大語言模型)將 JSON 逐筆自動轉成中文自然語言Python爬蟲: 理解 response.text 與 BeautifulSoup 對象之間的關鍵區別 from bs4 import BeautifulSoup as bs ; response = requests.get(url) ; soup = bs(response.text) ; bs4.element.Tag .find_all() ; .select() ; .find() 差別為何?soup是大HTML, tag是小HTML,可以使用相同的方法Python 正則表示法:零寬斷言實戰指南 (?=p) 正向先行 ; (?!p) 負向先行 ; (?<=p) 正向回顧 ; (?<!p) 負向回顧Python: namedtuple(可用屬性名或index拜訪元素)與tuple(只能用index拜訪元素)有何差異?namedtuple vs dictPython 字串分割全攻略:splitlines() 與 re.split() 的用法與比較
近期留言