劉任昌python,方法read(),seek(0),readlines(),input,in
file = open('金融常識.txt','r',encoding='utf-8')
lines = file.readlines()
file.seek(0) #讀完readlines()記憶體指標回到檔案開頭
reading = file.read() #上個星期read()是讀取所有字元
file.close()
print(len(lines), len(reading))
x = input('金一乙天大王輸入搜尋關鍵詞,列出所有題目: ')
n = 0
for line in lines:
if x in line: # if line.find(x) != -1: 使用python更強的功能in
n += 1 # 被更常使用
print(n, ' ',line,end="")#預設結束換列
print(f'\n總共{n}題目')
https://www.blogger.com/blog/post/edit/7117219004802242035/2765706405237430718
回覆刪除https://leeenming.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://chenjunjie592.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://wei-chen-chang.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://liushaouchi.blogspot.com/2026/10/pythonreadseek0readlinesinput.html
回覆刪除https://asdfgktifdjjej.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://zhonghexiao.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除https://hsy08311111.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://huangzhehui.blogspot.com/2026/10/pythonreadseekreadlines.html
回覆刪除https://wangyuzhen.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://zhiyao01.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://hsu1214328.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://jiexin0713.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://lzr0914.blogspot.com/2026/10/pythonreadseek0readseek0readlinesinputin.html
回覆刪除https://huangpeiling16.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除https://yangxinzhen.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除作者已經移除這則留言。
回覆刪除https://griuyijglkrijlrtfgfgf.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://chenyueying.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除https://kuozhehao.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除https://wumeiyingying181818.blogspot.com/2026/10/pythonreadseek0.html
回覆刪除https://www.blogger.com/blog/post/edit/7896241238449226961/2694554236198079735
回覆刪除https://yubiyu.blogspot.com/2026/10/pythonreadseek0readlinesin.html
回覆刪除https://ludingfeng.blogspot.com/2026/10/pythonreadseekreadlinesin.html
回覆刪除https://huang-hsin-ju.blogspot.com/2026/10/pre-file-open.html
回覆刪除https://wdwddq211223d.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://changjiahul.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://ryan052497.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://lin-takming.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://leexinni819.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://huang070207.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://dhyipgduwio3.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除https://yuuuyjghj.blogspot.com/2026/10/pythonreadseek0readlinesinputin.html
回覆刪除https://star2136.blogspot.com/2026/10/pythoninputfind-1.html
回覆刪除