劉任昌python字串方法in找到特定「題號」和題目

設定網頁的STYLE就是CSS=CASCADING STYLE SHEETS.
file = open('金融常識.txt','r',encoding='utf-8')
lines = file.readlines()
file.seek(0) #讀完readlines()記憶體指標回到檔案開頭
reading = file.read() #上個星期read()是讀取所有字元
file.close()
total=len(lines)
print(total, len(reading))
x = input('劉任昌輸入搜尋關鍵詞,列出所有題目: ')
n = 0
for i in range(total): #迴圈使用數字0到503
  if x in lines[i]: # if line.find(x) != -1: 使用python更強的功能in
      n += 1 #  被更常使用
      print(n, '題號',i+1,lines[i],end="")#預設結束換列
print(f'\n總共{n}題目')

劉任昌執行結果

504 37241
劉任昌輸入搜尋關鍵詞,列出所有題目: 選擇權  
1 題號 38 下列何者不屬於衍生性金融商品?(1)股票選擇權(2)債券期貨(3)組合式股票基金(4)利率交換合約
2 題號 55 期貨交易,指依國內外期貨交易所或其他期貨市場之規則或實務,從事衍生自商品、貨幣、有價證券、利率、指數或其他利益之下列何種契約之交易?(1)期貨契約(2)選擇權契約(3)期貨選擇權契約(4)以上皆是
3 題號 129 小黃因疫情慘澹失業後,個人經濟遭遇困難、信用紀錄也開始惡化,還好受惠於近年來金融業積極推動普惠金融服務,請問以下小黃獲得之幫助何者非屬普惠金融相關?(1)小黃得以較低保費取得基本保險保障(2)小黃報名參加某證券商舉辦的期貨商品投資講座,學習投資期貨或選擇權獲利(3)某銀行提供小黃低碳運輸微型貸款,幫助小黃購置電動機車代步、開啟外送員新人生(4)小黃透過完整的網銀服務,在失業期間為了節省房租而搬回鄉下老家時,也可以享受 e指理財、從線上進行基金申購
4 題號 210 認購權證之「發行者」相當於下列選擇權策略中那一種角色?(1)買進買權(Buy Call)(2)買進賣權(Buy Put) (3)賣出買權(Sell Call) (4)賣出賣權(Sell Put)
5 題號 211 以下那一種交易者不必繳交保證金?(1)期貨的買方 (2)選擇權的買方 (3)期貨的賣方 (4)選擇權的賣方
6 題號 286 外匯交易雙方在一特定時點簽訂契約,決定匯率,並於交易後第二個營業日完成契約金額的交割,稱為下列何者?(1)即期交易(2)遠期交易(3)期貨交易(4)選擇權交易

總共6題目
<STYLE>
PRE{BORDER:9PX SOLID RED;BACKGROUND:BLACK;COLOR:YELLOW;}
H1{BACKGROUND:PURPLE;COLOR:WHITE;TEXT-ALIGN:CENTER;PADDING:10PX}
</STYLE>

留言

  1. https://chenjunjie592.blogspot.com/2026/10/blog-post_19.html

    回覆刪除
  2. https://huang-hsin-ju.blogspot.com/2026/10/pythonin.html

    回覆刪除
  3. https://chenyueying.blogspot.com/2026/10/pythonin.html

    回覆刪除
  4. https://wdwddq211223d.blogspot.com/2026/10/pythonin.html

    回覆刪除
  5. https://leeenming.blogspot.com/2026/10/pythonin.html

    回覆刪除
  6. https://zhonghexiao.blogspot.com/2026/10/file-open_0780581735.html

    回覆刪除
  7. https://liushaouchi.blogspot.com/2026/10/pythonin.html

    回覆刪除
  8. https://huang070207.blogspot.com/2026/10/pythonin.html

    回覆刪除
  9. https://yubiyu.blogspot.com/2026/10/pythonin.html

    回覆刪除
  10. https://wei-chen-chang.blogspot.com/2026/10/pythonin.html

    回覆刪除
  11. https://griuyijglkrijlrtfgfgf.blogspot.com/2026/10/pythonin.html

    回覆刪除
  12. https://huangzhehui.blogspot.com/2026/10/pythonin.html

    回覆刪除
  13. https://cynthia088.blogspot.com/2026/10/pythonin.html

    回覆刪除
  14. https://changjiahul.blogspot.com/2026/10/pythonin.html

    回覆刪除
  15. https://dhyipgduwio3.blogspot.com/2026/10/pythonin.html

    回覆刪除
  16. https://asdfgktifdjjej.blogspot.com/2026/10/pythonin.html

    回覆刪除
  17. https://huangpeiling16.blogspot.com/2026/10/file-open.html

    回覆刪除
  18. https://dymtdfrudfytuimtyd.blogspot.com/2026/10/pythonin_0761265442.html

    回覆刪除
  19. https://linhong01.blogspot.com/2026/10/pythonin.html

    回覆刪除
  20. https://shhdjsxn.blogspot.com/2026/10/pythonin.html

    回覆刪除
  21. https://ianchen67.blogspot.com/2026/10/pythonin.html

    回覆刪除
  22. https://chinenkohana.blogspot.com/2026/10/pythonin.html

    回覆刪除
  23. https://chungxinying.blogspot.com/2026/10/pythonin.html

    回覆刪除
  24. https://zhiyao01.blogspot.com/2026/10/pythonin.html

    回覆刪除
  25. https://yangxinzhen.blogspot.com/2026/10/blog-post.html

    回覆刪除
  26. https://jiexin0713.blogspot.com/2026/10/pythonin.html

    回覆刪除
  27. https://hsy08311111.blogspot.com/2026/10/pythonin.html

    回覆刪除
  28. https://chiangyurou.blogspot.com/2026/10/pythonin.html

    回覆刪除
  29. https://dymtdfrudfytuimtyd.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  30. https://asdfgktifdjjej.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  31. https://huang-hsin-ju.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  32. https://griuyijglkrijlrtfgfgf.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  33. https://www.blogger.com/blog/post/edit/1023905489246085952/6210962947741223397

    回覆刪除
  34. https://yuuuyjghj.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  35. https://lzr0914.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  36. https://linhong01.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  37. https://wei-chen-chang.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  38. https://wangzhixian0508.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  39. https://ju890u56y77i.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  40. https://dhyipgduwio3.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  41. https://cynthia088.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  42. https://shhdjsxn.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  43. https://liushaouchi.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  44. https://chenyueying.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  45. https://lin-takming.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  46. https://ludingfeng.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  47. https://huang070207.blogspot.com/2026/11/blog-post.html

    回覆刪除
  48. https://wumeiyingying181818.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  49. https://kiannc1201.blogspot.com/2026/11/excel.html

    回覆刪除
  50. https://star2136.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  51. https://wdwddq211223d.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  52. https://hsy08311111.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  53. https://jiexin0713.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  54. https://chinenkohana.blogspot.com/2026/11/excel.html

    回覆刪除
  55. https://leeyousin.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  56. https://xuancenlin.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  57. https://leexinni819.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  58. https://866anita.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  59. https://zhouuuuu.blogspot.com/2026/11/blog-post_02.html

    回覆刪除
  60. https://huangzhehui.blogspot.com/2026/11/blog-post_02.html

    回覆刪除
  61. https://zhiyao01.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  62. https://chiangyurou.blogspot.com/2026/11/excelformulas.html

    回覆刪除
  63. https://chungxinying.blogspot.com/2026/11/excelformulas.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌Python產生金融常識Javascript測驗網頁

劉任昌EXCEL函數LEFT,MID,RIGHT及PYTHON方法FIND