{"id":1119727,"date":"2025-01-08T18:47:22","date_gmt":"2025-01-08T10:47:22","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1119727.html"},"modified":"2025-01-08T18:47:25","modified_gmt":"2025-01-08T10:47:25","slug":"python%e5%a6%82%e4%bd%95%e7%94%a8%e4%b8%a4%e4%b8%aa%e5%88%97%e8%a1%a8%e5%88%9b%e5%bb%ba%e5%ad%97%e5%85%b8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1119727.html","title":{"rendered":"python\u5982\u4f55\u7528\u4e24\u4e2a\u5217\u8868\u521b\u5efa\u5b57\u5178"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082701\/3423856f-7df1-4609-a4ef-b1bd1257d009.webp\" alt=\"python\u5982\u4f55\u7528\u4e24\u4e2a\u5217\u8868\u521b\u5efa\u5b57\u5178\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong>\uff0c\u4f8b\u5982\u4f7f\u7528<code>zip()<\/code>\u51fd\u6570\u3001\u5b57\u5178\u63a8\u5bfc\u5f0f\u6216\u4f7f\u7528<code>dict()<\/code>\u6784\u9020\u51fd\u6570\u3002<strong>\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528zip()\u51fd\u6570<\/strong>\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e24\u4e2a\u5217\u8868\u5143\u7d20\u4e00\u4e00\u914d\u5bf9\u5f62\u6210\u952e\u503c\u5bf9\uff0c\u8fdb\u800c\u521b\u5efa\u5b57\u5178\u3002<strong>\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u5982\u4e0b<\/strong>\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528 <code>zip()<\/code> \u51fd\u6570<\/p>\n<\/p>\n<p><p>\u4f7f\u7528 <code>zip()<\/code> \u51fd\u6570\u662f\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002<code>zip()<\/code> \u51fd\u6570\u5c06\u4e24\u4e2a\u5217\u8868\u5143\u7d20\u4e00\u4e00\u914d\u5bf9\u5f62\u6210\u5143\u7ec4\uff0c\u7136\u540e\u901a\u8fc7 dict() \u6784\u9020\u51fd\u6570\u5c06\u8fd9\u4e9b\u5143\u7ec4\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 zip() \u548c dict() \u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = dict(zip(keys, values))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f<\/p>\n<\/p>\n<p><p>\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u7b80\u6d01\u7684\u65b9\u5f0f\u6765\u521b\u5efa\u5b57\u5178\u3002\u901a\u8fc7\u8fed\u4ee3\u4e24\u4e2a\u5217\u8868\u7684\u7d22\u5f15\uff0c\u5c06\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u914d\u5bf9\u5e76\u6dfb\u52a0\u5230\u5b57\u5178\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = {keys[i]: values[i] for i in range(len(keys))}<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528 <code>dict()<\/code> \u6784\u9020\u51fd\u6570\u548c <code>zip()<\/code> \u51fd\u6570\u7684\u7ec4\u5408<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u76f4\u63a5\u4f7f\u7528 <code>zip()<\/code> \u51fd\u6570\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5c06 <code>zip()<\/code> \u51fd\u6570\u7684\u7ed3\u679c\u4f20\u9012\u7ed9 <code>dict()<\/code> \u6784\u9020\u51fd\u6570\uff0c\u8fd9\u4e5f\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 dict() \u6784\u9020\u51fd\u6570\u548c zip() \u51fd\u6570\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = dict(zip(keys, values))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u5faa\u73af<\/p>\n<\/p>\n<p><p>\u867d\u7136 <code>zip()<\/code> \u51fd\u6570\u548c\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u6700\u7b80\u6d01\u7684\u65b9\u6cd5\uff0c\u4f46\u5982\u679c\u4f60\u5e0c\u671b\u66f4\u52a0\u660e\u786e\u5730\u63a7\u5236\u5b57\u5178\u7684\u521b\u5efa\u8fc7\u7a0b\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528\u5faa\u73af\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = {}<\/p>\n<p>for i in range(len(keys)):<\/p>\n<p>    dictionary[keys[i]] = values[i]<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u5904\u7406\u5217\u8868\u957f\u5ea6\u4e0d\u4e00\u81f4\u7684\u60c5\u51b5<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e24\u4e2a\u5217\u8868\u957f\u5ea6\u4e0d\u4e00\u81f4\u7684\u60c5\u51b5\u3002\u6b64\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>itertools.zip_longest()<\/code> \u51fd\u6570\u6765\u586b\u5145\u8f83\u77ed\u7684\u5217\u8868\uff0c\u907f\u514d\u6570\u636e\u4e22\u5931\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from itertools import zip_longest<\/p>\n<p>keys = [&#39;name&#39;, &#39;age&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 zip_longest() \u5904\u7406\u5217\u8868\u957f\u5ea6\u4e0d\u4e00\u81f4\u7684\u60c5\u51b5<\/strong><\/h2>\n<p>dictionary = dict(zip_longest(keys, values, fillvalue=None))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001\u4f7f\u7528 <code>map()<\/code> \u51fd\u6570<\/p>\n<\/p>\n<p><p><code>map()<\/code> \u51fd\u6570\u5e38\u7528\u4e8e\u5c06\u4e00\u4e2a\u51fd\u6570\u5e94\u7528\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u5217\u8868\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u3002\u867d\u7136\u4e0d\u5982 <code>zip()<\/code> \u51fd\u6570\u76f4\u63a5\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 map() \u51fd\u6570\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = dict(map(lambda k, v: (k, v), keys, values))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e03\u3001\u4f7f\u7528 <code>pandas<\/code> \u5e93<\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5df2\u7ecf\u5728\u4f7f\u7528 <code>pandas<\/code> \u5e93\u8fdb\u884c\u6570\u636e\u5206\u6790\uff0c\u4e5f\u53ef\u4ee5\u5229\u7528 <code>pandas<\/code> \u5e93\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\u3002<code>pandas<\/code> \u5e93\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u529f\u80fd\uff0c\u9002\u5408\u5904\u7406\u8f83\u5927\u6570\u636e\u96c6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 pandas \u5e93\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>df = pd.DataFrame({&#39;keys&#39;: keys, &#39;values&#39;: values})<\/p>\n<p>dictionary = pd.Series(df.values.values, index=df.keys).to_dict()<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516b\u3001\u4f7f\u7528 <code>numpy<\/code> \u5e93<\/p>\n<\/p>\n<p><p>\u7c7b\u4f3c\u4e8e <code>pandas<\/code> \u5e93\uff0c<code>numpy<\/code> \u5e93\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\u3002<code>numpy<\/code> \u5e93\u4e13\u6ce8\u4e8e\u6570\u503c\u8fd0\u7b97\uff0c\u9002\u5408\u9700\u8981\u9ad8\u6027\u80fd\u8ba1\u7b97\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 numpy \u5e93\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = dict(np.column_stack((keys, values)))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e5d\u3001\u4f7f\u7528 <code>collections<\/code> \u5e93\u4e2d\u7684 <code>OrderedDict<\/code><\/p>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5e0c\u671b\u521b\u5efa\u4e00\u4e2a\u6709\u5e8f\u5b57\u5178\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>collections<\/code> \u5e93\u4e2d\u7684 <code>OrderedDict<\/code> \u7c7b\u3002\u8fd9\u6837\u521b\u5efa\u7684\u5b57\u5178\u4f1a\u4fdd\u6301\u952e\u503c\u5bf9\u7684\u63d2\u5165\u987a\u5e8f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import OrderedDict<\/p>\n<p>keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 OrderedDict \u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u6709\u5e8f\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = OrderedDict(zip(keys, values))<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: OrderedDict([(&#39;name&#39;, &#39;Alice&#39;), (&#39;age&#39;, 25), (&#39;city&#39;, &#39;New York&#39;)])<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5341\u3001\u4f7f\u7528 <code>dict.fromkeys()<\/code> \u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u867d\u7136 <code>dict.fromkeys()<\/code> \u65b9\u6cd5\u901a\u5e38\u7528\u4e8e\u521b\u5efa\u4e00\u4e2a\u5b57\u5178\uff0c\u5e76\u5c06\u6240\u6709\u952e\u6620\u5c04\u5230\u76f8\u540c\u7684\u503c\uff0c\u4f46\u901a\u8fc7\u4e00\u4e9b\u5de7\u5999\u7684\u5904\u7406\uff0c\u4e5f\u53ef\u4ee5\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">keys = [&#39;name&#39;, &#39;age&#39;, &#39;city&#39;]<\/p>\n<p>values = [&#39;Alice&#39;, 25, &#39;New York&#39;]<\/p>\n<h2><strong>\u4f7f\u7528 dict.fromkeys() \u65b9\u6cd5\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178<\/strong><\/h2>\n<p>dictionary = dict.fromkeys(keys)<\/p>\n<p>for i, key in enumerate(dictionary.keys()):<\/p>\n<p>    dictionary[key] = values[i]<\/p>\n<p>print(dictionary)<\/p>\n<h2><strong>\u8f93\u51fa: {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0cPython \u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\uff0c\u5177\u4f53\u65b9\u6cd5\u7684\u9009\u62e9\u53d6\u51b3\u4e8e\u5b9e\u9645\u5e94\u7528\u573a\u666f\u548c\u4e2a\u4eba\u504f\u597d\u3002\u65e0\u8bba\u662f\u4f7f\u7528 <code>zip()<\/code> \u51fd\u6570\u3001\u5b57\u5178\u63a8\u5bfc\u5f0f\u8fd8\u662f\u5176\u4ed6\u65b9\u6cd5\uff0c\u90fd\u53ef\u4ee5\u5feb\u901f\u9ad8\u6548\u5730\u5b9e\u73b0\u8fd9\u4e00\u9700\u6c42\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\uff0c\u80fd\u591f\u66f4\u597d\u5730\u5904\u7406\u6570\u636e\uff0c\u63d0\u9ad8\u7f16\u7a0b\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u7528\u4e24\u4e2a\u5217\u8868\u521b\u5efa\u5b57\u5178\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528Python\u4e2d\u7684<code>zip<\/code>\u51fd\u6570\u5c06\u4e24\u4e2a\u5217\u8868\u914d\u5bf9\uff0c\u7136\u540e\u5c06\u5b83\u4eec\u8f6c\u6362\u4e3a\u5b57\u5178\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u5305\u542b\u952e\u7684\u5217\u8868\u548c\u4e00\u4e2a\u5305\u542b\u503c\u7684\u5217\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">keys = [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;]\nvalues = [1, 2, 3]\nresult_dict = dict(zip(keys, values))\n<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u5f97\u5230\u4e86\u4e00\u4e2a\u5b57\u5178<code>{&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/code>\u3002<\/p>\n<p><strong>\u5728\u521b\u5efa\u5b57\u5178\u65f6\uff0c\u5217\u8868\u7684\u957f\u5ea6\u6709\u8981\u6c42\u5417\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u4e24\u4e2a\u5217\u8868\u7684\u957f\u5ea6\u5e94\u8be5\u76f8\u540c\u3002\u5982\u679c\u5b83\u4eec\u7684\u957f\u5ea6\u4e0d\u540c\uff0c<code>zip<\/code>\u51fd\u6570\u5c06\u53ea\u914d\u5bf9\u5230\u6700\u77ed\u5217\u8868\u7684\u957f\u5ea6\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u90e8\u5206\u952e\u503c\u5bf9\u4e22\u5931\u3002\u56e0\u6b64\uff0c\u786e\u4fdd\u4e24\u4e2a\u5217\u8868\u957f\u5ea6\u4e00\u81f4\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<p><strong>\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\u521b\u5efa\u5b57\u5178\u5417\uff1f<\/strong><br \/>\u9664\u4e86\u4f7f\u7528<code>zip<\/code>\u51fd\u6570\uff0c\u8fd8\u6709\u5176\u4ed6\u65b9\u6cd5\u53ef\u4ee5\u521b\u5efa\u5b57\u5178\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\uff1a<\/p>\n<pre><code class=\"language-python\">result_dict = {keys[i]: values[i] for i in range(len(keys))}\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u540c\u6837\u80fd\u591f\u5c06\u4e24\u4e2a\u5217\u8868\u8f6c\u6362\u4e3a\u5b57\u5178\uff0c\u5e76\u4e14\u5728\u5904\u7406\u8f83\u590d\u6742\u7684\u903b\u8f91\u65f6\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5c06\u4e24\u4e2a\u5217\u8868\u5408\u5e76\u4e3a\u5b57\u5178\uff0c\u4f8b\u5982\u4f7f\u7528zip()\u51fd\u6570\u3001\u5b57\u5178\u63a8\u5bfc\u5f0f\u6216\u4f7f\u7528dict()\u6784\u9020 [&hellip;]","protected":false},"author":3,"featured_media":1119730,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119727"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1119727"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119727\/revisions"}],"predecessor-version":[{"id":1119733,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119727\/revisions\/1119733"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1119730"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1119727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1119727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1119727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}