file = open('金融常識.txt','r',encoding='utf-8') reading = file.read() file.seek(0) #回到檔案的開始 lines = file.readlines() file.close() print('read()方法讀共', len(reading), 'readlines()方法讀共', len(lines)) x = input('劉任昌輸入搜尋關鍵詞: ') n = 0 for line in lines: if x in line: n=n+1 print( n, ' ', line,end='') print(f'總共{n}題')
915.商業軟體。https://xuancenlin.blogspot.com/2026/09/excelleftmidrightpythonfind.html
回覆刪除0914,金融市場常識測驗網頁,順利執行。https://xuancenlin.blogspot.com/2026/09/python.html
907.w3schools. https://xuancenlin.blogspot.com/2026/09/print-type-ord-chr.html