劉劭祺python,方法read(),seek(0),readlines(),input,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:
      n += 1
      print(n ,'',line,end="")
print(f'\n總共{n}題')
  

留言

  1. 金融市場測驗不能執行。https://liushaouchi.blogspot.com/2026/09/excel.html
    商業軟體期中考沒有截圖。https://liushaouchi.blogspot.com/2026/11/excelformulas.html
    1026.軟體。https://liushaouchi.blogspot.com/2026/10/excelvlookupindirectctrl-shift-enter.html
    計算機。https://liushaouchi.blogspot.com/2026/11/htmlcssjavascript.html
    俄羅斯方塊。https://liushaouchi.blogspot.com/2026/11/0-0-y-for-let-x-0-x-arenay.html
    俄羅斯方塊。https://liushaouchi.blogspot.com/2026/11/htmlcssjavascriptblogger.html
    程式設計期中考很完整。https://liushaouchi.blogspot.com/2026/11/htmlcssjavascriptpython.html
    1019.https://liushaouchi.blogspot.com/2026/10/pythonreadseek0readlinesinput.html
    你優秀到會讓其他人靠*https://liushaouchi.blogspot.com/2026/10/pythonin.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉劭祺EXCEL函數COUNTIF樞紐分析