Author: 儲蓄保險王
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...
Python TQC考題706 全字母句,set()元素不會重複,strNew=str1.replace(” “,””)
#Python TQC考題706 全字母句 k=eval(input...
近期留言