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 TQC考題210_三角形判斷,if 條件1:動作1 elif 條件2:動作2, else: 動作n,==為邏輯判斷式,=為指定Python: 如何使用 subprocess.run() 執行外部命令?Python: 如何將wav檔轉為文字? import speech_recognition as sr ; import soundfilePython: 2D array/list的切片,建立dict的方法:dic = dict(2D list) ; set1 = set(dic) #2D list可以轉為dict, dict的key可以轉為setPython爬蟲:BeautifulSoup的 .find_all() 與 .find() 與 .select('標籤名[屬性名1="屬性值1"][屬性名2="屬性值2"]') ; from bs4 import BeautifulSoup ; Live Server(可以預覽HTML的VS Code套件)Python: 二進制的負數如何表示?補數Python: jieba (中文斷詞套件) 如何萃取關鍵字? import jieba.analyse ; jieba.analyse.extract_tags()Windows熱鍵, Word TAB定位點,尋找取代Python:繁簡互轉 pip install opencc-python-reimplemented
0 Python: Matplotlib 中如何將圖例放置在繪圖之外? plt.legend(bbox_to_anchor=(1.05, 1.0), loc=’upper left’) ; plt.tight_layout() ; 如何防止儲存的檔案圖例被裁切? plt.savefig(‘example.png’, dpi=300, format=’png’, bbox_extra_artists=(lg,), bbox_inches=’tight’) 2023-05-01
0 Python 高階函數三劍客: map、filter、reduce #以函數作為參數,或回傳函數的函數; list(filter(None, data)) ; reduce( lambda acc, x: acc + x, map(lambda x: x * 2, filter(lambda x: x % 2 == 0, numbers))) 2025-12-20
0 Python物件導向(Object-oriented programming,簡稱OOP),類別(Class), 物件(Object), 屬性(Attribute)=變數, 方法(Method)=函式, 建構式(Constructor) def __init__(self,x,y): 計算計程車車資, assert 斷言, 全域變數與區域變數 2022-09-20
近期留言