file = open('金融常識.txt','r',encoding='utf-8') reading = file.read() file.close() print('檔案字元characters數:', len(reading)) mySet = set(reading)#將串列轉成集合,稱她 mySet得到1251 myDict = dict() #定義字典dict稱他為 myDict例如改成DoraSet for j in mySet: myDict[j] = 0 for i in reading: myDict[i] += 1 for j in mySet: print(f"字元「{j}」出現{myDict[j]:,}次數") print(f'字元數目{len(reading):,},不同字元數{len(mySet):,}') #python和其他所有語言不同的特徵 f string格式化字串文字 print(f"徐湘潔統計左引號(出現次數{myDict['(']:,}") print(f'徐湘潔統計右引號)出現次數{myDict[")"]:,}') print(F'''徐湘潔python計算格式化字串統計「管﹞{myDict['管']}''') print(f'徐湘潔統計504每題四個選項至少有{504*4:,}') 字元「殖」出現3次數 字元「百」出現9次數 字元「略」出現7次數 字元「飆」出現1次數 字元「結」出現30次數 字元「仍」出現6次數 字元「取」出現26次數 字元「好」出現21次數 字元「託」出現179次數 字元「面」出現29次數 字元「H」出現2次數 字元「未」出現27次數 字元「午」出現1次數 字元「幫」出現3次數 字元「權」出現96次數 字元「片」出現1次數 字元「棄」出現1次數 字元「櫃」出現18次數 字元「簽」出現18次數 字元「同」出現49次數 字元「外」出現53次數 字元「‧」出現1次數 字元「啟」出現1次數 字元數目37,241,不同字...
1027.商業軟體,講實話的學生,一定要受到獎勵!https://yubiyu.blogspot.com/2026/10/excelvlookupindirectctrl-shift-enter.html
回覆刪除915商業軟體,excel函數left,right,mid.https://yubiyu.blogspot.com/2026/09/excelleftmidrightpythonfind.html
商業軟體,countif.https://yubiyu.blogspot.com/2026/10/excelcountif.html
1019.input.https://yubiyu.blogspot.com/2026/10/pythonin.html
1018.seek().https://yubiyu.blogspot.com/2026/10/pythonreadseek0readlinesin.html
914金融常識順利執行,反白呈現正確答案。https://yubiyu.blogspot.com/2026/09/python_01637869624.html