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執行結果 特價 批發價--舒肥嫩雞胸100入 特價 零死角完美底妝 小富翁 美妝蛋5個 特價 防曬黑膠自動傘星點_6色 德國ALUTEC 輕量化鋁箱 Industry 48L 特價 鎳鐵隕石-天鐵隕石金剛杵墜 7.4g 避邪除障 特價 【Herschel】Classic Backpack 13 吋/14 吋 後背包-黑/極致黑/ 相關文章Python: 如何使用pandas.to_numeric ( df['numbers'], errors='coerce') 將非數值型資料轉為NaN? df['numbers'].describe() 簡述統計資料Python: 如何使用graphviz套件繪製流程圖? 如何創建子圖? with g.subgraph(name='cluster_0') as c:Python:如何建立新資料夾?os.mkdir() ; os.makedirs() ; 有何差別?Python爬蟲: Selenium 的 expected_conditions 與 例外狀況; from selenium.webdriver.support import expected_conditions as EC ; from selenium.common.exceptions import NoSuchElementException, TimeoutExceptionPython: 如何計算全文件詞頻(term frequency,簡稱TF)?如何使用jieba做中文斷詞? lis_jieba = jieba.lcut(strr)Python: 如何使用docx套件,在word文件中插入一個帶有超連結的文字? from docx.oxml.shared import OxmlElement, qnPython:如何使用 pyautogui 進行自動點擊?Python: matplotlib.pyplot ; lines = ax.plot(x, y) ; 如果y是2D的 pandas.DataFrame ; 如何一次加入所有欄標籤當作圖例(legend)的labels? labels= y.columns.tolist() ; ax.legend(lines, labels)Python: 格式化字串 .format() 順序order,關鍵字keyword,索引index .2% 換算為百分比,精準到小數點下兩位
0 Python機器學習: 決策樹 (DecisionTreeClassifier) ; from sklearn.tree import DecisionTreeClassifier ; tree = DecisionTreeClassifier(criterion = “gini”) #criterion = “entropy” #criterion: 標準,準則 2022-12-26
0 Python: 如何使用matplotlib繪製盒鬚圖?df.boxplot(column=’value’, by=’fixture’, grid=False, showmeans=True, showfliers=True, ax=ax) ; 如何獲取pandas.DataFrame多層索引MultiIndex中的第二層內容? df.columns.get_level_values(1).unique() 2025-01-15
0 Python:字典dict()如何一次讀出所有keys, values, items? dic.keys() ; set(dic) 無序; dic.values() ; dic.items() 2022-10-11
近期留言