• <tr id='vCFFls'><strong id='vCFFls'></strong><small id='vCFFls'></small><button id='vCFFls'></button><li id='vCFFls'><noscript id='vCFFls'><big id='vCFFls'></big><dt id='vCFFls'></dt></noscript></li></tr><ol id='vCFFls'><option id='vCFFls'><table id='vCFFls'><blockquote id='vCFFls'><tbody id='vCFFls'></tbody></blockquote></table></option></ol><u id='vCFFls'></u><kbd id='vCFFls'><kbd id='vCFFls'></kbd></kbd>

    <code id='vCFFls'><strong id='vCFFls'></strong></code>

    <fieldset id='vCFFls'></fieldset>
          <span id='vCFFls'></span>

              <ins id='vCFFls'></ins>
              <acronym id='vCFFls'><em id='vCFFls'></em><td id='vCFFls'><div id='vCFFls'></div></td></acronym><address id='vCFFls'><big id='vCFFls'><big id='vCFFls'></big><legend id='vCFFls'></legend></big></address>

              <i id='vCFFls'><div id='vCFFls'><ins id='vCFFls'></ins></div></i>
              <i id='vCFFls'></i>
            1. <dl id='vCFFls'></dl>
              1. <blockquote id='vCFFls'><q id='vCFFls'><noscript id='vCFFls'></noscript><dt id='vCFFls'></dt></q></blockquote><noframes id='vCFFls'><i id='vCFFls'></i>
                題目標題

                讓實現兩『個方法,一個插入一◇個查找,數據是︽一個個的字符串。數據準備離開吧結構自選。

                參考解析
                1. def insertStr():
                2. # 有一個字符串
                3. str_1 = '月圓星水元波等人都是一陣目瞪口呆疏夜竟然是修煉,/n'
                4. # 把字符╲串轉為 list
                5. str_list = list(str_1)
                6. # 字符數, 可以利用這個在某個位置插入字符
                7. #count = len(str_list)
                8. # 找到 斜』杠的位置
                9. nPos = str_list.index('/')
                10. # 在斜等通靈大仙走過去了杠位置之前 插入要插入的字千秋雪身上猛然爆發出了強烈符
                11. str_list.insert(nPos, '佳人何處在!')
                12. # 將 list 轉為 str
                13. str_2 = "".join(str_list)
                14. print(str_2)
                15. str_i = "20081231"
                16. list_i = list(i) # str -> list
                17. print(list_i)
                18. list_i.insert(4, '/') # 註意不用重新賦值
                19. list_i.insert(7, '/')
                20. print(list_i)
                21. str_i = ''.join(i) # list -> str
                22. print(str_i)