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爬蟲: Selenium 的 expected_conditions 與 例外狀況; from selenium.webdriver.support import expected_conditions as EC ; from selenium.common.exceptions import NoSuchElementException, TimeoutExceptionPython: 如何在Excel儲存格中自動換行? cell.alignment = openpyxl.styles.Alignment( wrapText =True) #pd.DataFrame.from_dictPython: 循環播放 英文單詞及其中文翻譯 ; from gtts import gTTSPython 字符串方法示例:isdigit() #全數字?、isalpha() #全字母?、isalnum() #全字母或數字?、islower() #全小寫? 和 isupper() #全大寫?Python: 如何使用selenium自動開啟Chrome瀏覽器,輸入關鍵字後,按ENTER,搜尋圖片? 如何抓下所有大圖?Python: 如何使用docx套件,在word文件中插入一個帶有超連結的文字? from docx.oxml.shared import OxmlElement, qnPython: pandas.Series如何只保留str,去除重複值?#isinstance(x:Any, str) -> bool #.drop_duplicates() #Series.apply( function )逐元素應用function運算 #DataFrame.apply( function )逐Series應用function運算 .drop_duplicates() 跟.unique()有何差別? df.drop_duplicates() 等效於 df[~df.duplicated()]Python 正則表示法(Regular Expression) : re.Match 物件的 .group() .groups()方法 #捕獲組Python: 如何傳遞不定長度參數到function中? *args ; **kwargs
近期留言