Monthly Archive: 5 月 2022
Python TQC考題904 資料計算, with open() as file: for line in file: L.append(line.split())
#Python TQC考題904 資料計算 # 跟910可以互相比對...
Python串列 .reverse()反轉 .sort()排序 .remove(“指定元素”)移除 .pop(index)移除, 字串.replace(old,new) .lower()小寫 .upper()大寫 .title()首字大寫
#Python串列 .reverse() .sort() .remo...
Python TQC考題806 字元次數計算 s.count(c) 計算c字元在s字串中出現了幾次,字串跟list都可以.count()
#Python TQC考題806 字元次數計算 def comput...
Python TQC考題802 字元對應,ASCII碼ord(), chr(), list(str)會把字串的每一個字母拆分進入list中,string跟list都可以使用index定位,沒有非要將string轉為list, for i in str: i 也可以依序代入str的每一個chr
#Python TQC考題802 字元對應 s=input() su...
近期留言