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: 如何檢查NaN(Not a Number)? 為什麼 np.nan == np.nan 返回 False? numpy.isnan() ; pandas.isna() ; pandas.isnull() ; np.isnan() 只能處理數值型資料(np.nan) ; pd.isna() , pd.isnull() 除了np.nan以外,還可以處理None, pd.DataFrame, pd.SeriesPython中的時間處理簡介; timestamp: float = time.time() #獲取時間戳; localtime = time.localtime( timestamp ) #獲取localtime; strftime = time.strftime('%Y-%m-%d %H:%M:%S', localtime) #獲取strftime #str format timePython: 如何錄製wav檔? import sounddevice ; from scipy.io.wavfile import writePython: 深入理解 pandas.concat():使用 ignore_index=True 合併 DataFrame 的奧秘 #效果同 reset_index( drop=True )Python: 如何使用正則表示法(Regular Expression)非貪婪模式(.*?) or (.+?),取出以下字串所有被雙引號包圍的部分?response: addr="0000:01:00.0" vid="0x144d" did="0xa826" svid="0x144d" sid="0xab4c" speed="16.0GT/s" width="x4" max_width="x4" expected_width="x4" expected_speed="16.0GT/s" devpath="/phys/SB_CAB0/DOWNLINK/U2_15:device:nvme:nvme"Python: 如何使用functools.reduce逐步縮減可迭代對象,合併為單個結果? import functools; product = functools.reduce( lambda x, y: x * y, numbers) ; reduce(function, sequence [, initial]) -> value ; map(function, iterable) ; filter(function, iterable) ; map ; filterPython: 如何計算全文件詞頻(term frequency,簡稱TF)?如何使用jieba做中文斷詞? lis_jieba = jieba.lcut(strr)Python TQC考題: 輸入一個正整數n,並讀取read.txt內容,將首n列的每個英文字首字大寫輸出write.txt ; pandas.Series.str.title() #輸出csv或xlsx時,如何不輸出index 跟 header ? .to_csv( "write.txt", index=False, header=False)Python TQC考題510: 星號輸出;pandas.DataFrame 如何轉為str? .to_string( index=False, header=False)
0 Python: sorted() 排序,參數key = lambda 匿名函式 ;物件導向 def __repr__(self): #原形畢露; def __str__(self): #給人閱讀 2022-12-21
0 Taxas Instruments TI AWR1443BOOST EVM: mmWave Demo Visualizer 按”SEND CONFIG TO MMWAVE DEVICE” 若沒反應怎麼處理? 2023-02-17
近期留言