{"id":204966,"date":"2025-05-29T11:15:31","date_gmt":"2025-05-29T03:15:31","guid":{"rendered":"https:\/\/server.hk\/cnblog\/204966\/"},"modified":"2025-05-29T11:15:31","modified_gmt":"2025-05-29T03:15:31","slug":"python-%e5%88%97%e8%a1%a8-index-%e6%96%b9%e6%b3%95%e4%b8%ba%e4%bb%80%e4%b9%88%e8%be%93%e5%87%ba-5%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/204966\/","title":{"rendered":"Python \u5217\u8868 index \u65b9\u6cd5\u4e3a\u4ec0\u4e48\u8f93\u51fa 5\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Python \u5217\u8868 index \u65b9\u6cd5\u4e3a\u4ec0\u4e48\u8f93\u51fa 5\uff1f<\/h1>\n<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732089843673d97f36df0b.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>python3 \u7684 index \u7591\u95ee<\/strong><\/p>\n<p>\u8003\u8651\u5982\u4e0b\u4ee3\u7801\u6bb5\uff1a<\/p>\n<pre>m = [1,2,3,4,34,4,5,6]\nn = m.index(4,4,6)\nprint(n)<\/pre>\n<p>\u8fd9\u4e2a\u4ee3\u7801\u6bb5\u5c06\u8f93\u51fa 5\u3002<\/p>\n<p><strong>\u4e3a\u4ec0\u4e48\u7ed3\u679c\u662f 5<\/strong><\/p>\n<p>index \u65b9\u6cd5\u7528\u4e8e\u67e5\u627e\u67d0\u4e2a\u503c\u5728\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5339\u914d\u9879\u3002\u5728\u8fd9\u4e2a\u4ee3\u7801\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u6b63\u5728\u67e5\u627e\u5024 4 \u7684\u7d22\u5f15\uff0c\u4ece\u7d22\u5f15 4 \u5f00\u59cb\uff0c\u5230\u7d22\u5f15 6 \u7ed3\u675f\uff08\u4e0d\u5305\u62ec\u7d22\u5f15 6\uff09\u3002<\/p>\n<p>m \u5217\u8868\u4e2d\u7b2c\u4e00\u4e2a\u5339\u914d\u9879\u4f4d\u4e8e\u7d22\u5f15 5\uff0c\u56e0\u6b64 n \u7684\u503c\u4e3a 5\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300aPython \u5217\u8868 index \u65b9\u6cd5\u4e3a\u4ec0\u4e48\u8f93\u51fa 5\uff1f\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python \u5217\u8868 index &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-204966","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=204966"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204966\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=204966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=204966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=204966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}