徐湘潔python,方法read(),seek(0),readlines(),in
file = open('金融常識.txt','r',encoding='utf-8')
lines = file.readlines()
file.seek(0)
reading = file,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}題目')
1027.商業軟體,講實話的學生,一定要受到獎勵!https://yubiyu.blogspot.com/2026/10/excelvlookupindirectctrl-shift-enter.html
回覆刪除915商業軟體,excel函數left,right,mid.https://yubiyu.blogspot.com/2026/09/excelleftmidrightpythonfind.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