{"id":981306,"date":"2024-12-27T07:01:36","date_gmt":"2024-12-26T23:01:36","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/981306.html"},"modified":"2024-12-27T07:01:38","modified_gmt":"2024-12-26T23:01:38","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e5%88%9b%e5%bb%ba%e5%ad%97%e5%85%b8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/981306.html","title":{"rendered":"python\u4e2d\u5982\u4f55\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\/24210323\/59031f21-fa36-4d73-991d-92c7c8f84b0a.webp\" alt=\"python\u4e2d\u5982\u4f55\u521b\u5efa\u5b57\u5178\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u521b\u5efa\u5b57\u5178\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\u5b9e\u73b0\uff0c<strong>\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5927\u62ec\u53f7\u3001\u4f7f\u7528<code>dict()<\/code>\u6784\u9020\u51fd\u6570\u3001\u4ece\u952e\u503c\u5bf9\u5e8f\u5217\u521b\u5efa\u3001\u901a\u8fc7\u5b57\u5178\u63a8\u5bfc\u5f0f\u521b\u5efa<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u5927\u62ec\u53f7\u548c<code>dict()<\/code>\u6784\u9020\u51fd\u6570\u662f\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u901a\u8fc7\u5927\u62ec\u53f7\u521b\u5efa\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u5927\u62ec\u53f7\u521b\u5efa\u5b57\u5178\uff1a<\/strong>\u8fd9\u662f\u6700\u76f4\u89c2\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u5927\u62ec\u53f7\u4e2d\u76f4\u63a5\u6307\u5b9a\u952e\u503c\u5bf9\u3002\u4f8b\u5982\uff0c<code>my_dict = {&#39;key1&#39;: &#39;value1&#39;, &#39;key2&#39;: &#39;value2&#39;}<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u660e\u4e86\uff0c\u9002\u7528\u4e8e\u624b\u52a8\u5b9a\u4e49\u5c11\u91cf\u7684\u952e\u503c\u5bf9\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8\u5728Python\u4e2d\u521b\u5efa\u5b57\u5178\u7684\u5404\u79cd\u65b9\u5f0f\u53ca\u5176\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u5927\u62ec\u53f7\u521b\u5efa\u5b57\u5178<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u5927\u62ec\u53f7 <code>{}<\/code> \u6765\u521b\u5efa\u5b57\u5178\u662f\u6700\u5e38\u7528\u4e14\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u5b57\u5178\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u7531\u4e00\u4e2a\u952e\u53ca\u5176\u5bf9\u5e94\u7684\u503c\u7ec4\u6210\uff0c\u952e\u548c\u503c\u7528\u5192\u53f7 <code>:<\/code> \u5206\u9694\uff0c\u952e\u503c\u5bf9\u4e4b\u95f4\u7528\u9017\u53f7 <code>,<\/code> \u5206\u9694\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u5b57\u5178<\/p>\n<p>person = {&#39;name&#39;: &#39;Alice&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5b57\u5178 <code>person<\/code> \u5305\u542b\u4e86\u4e09\u4e2a\u952e\u503c\u5bf9\uff1a<code>&#39;name&#39;<\/code> \u5bf9\u5e94 <code>&#39;Alice&#39;<\/code>\uff0c<code>&#39;age&#39;<\/code> \u5bf9\u5e94 <code>25<\/code>\uff0c\u4ee5\u53ca <code>&#39;city&#39;<\/code> \u5bf9\u5e94 <code>&#39;New York&#39;<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u5f53\u4f60\u5df2\u7ecf\u77e5\u9053\u6240\u6709\u952e\u548c\u503c\u65f6\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9\uff1a<\/h4>\n<\/p>\n<ul>\n<li><strong>\u76f4\u89c2\u6e05\u6670<\/strong>\uff1a\u76f4\u63a5\u5728\u4ee3\u7801\u4e2d\u770b\u5230\u952e\u503c\u5bf9\u3002<\/li>\n<li><strong>\u53ef\u8bfb\u6027\u5f3a<\/strong>\uff1a\u9002\u5408\u5b9a\u4e49\u5c11\u91cf\u4e14\u56fa\u5b9a\u7684\u952e\u503c\u5bf9\u3002<\/li>\n<\/ul>\n<p><h4>\u6ce8\u610f\u4e8b\u9879\uff1a<\/h4>\n<\/p>\n<ul>\n<li>\u952e\u5fc5\u987b\u662f\u4e0d\u53ef\u53d8\u7c7b\u578b\uff0c\u5982\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u6216\u5143\u7ec4\u3002<\/li>\n<li>\u5b57\u5178\u4e2d\u7684\u952e\u662f\u552f\u4e00\u7684\uff0c\u91cd\u590d\u7684\u952e\u4f1a\u8986\u76d6\u4e4b\u524d\u7684\u503c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u4f7f\u7528 <code>dict()<\/code> \u6784\u9020\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Python \u63d0\u4f9b\u4e86\u5185\u7f6e\u7684 <code>dict()<\/code> \u51fd\u6570\u6765\u521b\u5efa\u5b57\u5178\u3002<code>dict()<\/code> \u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff0c\u901a\u5e38\u662f\u4e00\u4e2a\u5305\u542b\u4e8c\u5143\u7ec4\uff08\u952e\u503c\u5bf9\uff09\u7684\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 dict() \u6784\u9020\u51fd\u6570\u521b\u5efa\u5b57\u5178<\/p>\n<p>person = dict(name=&#39;Alice&#39;, age=25, city=&#39;New York&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>name=&#39;Alice&#39;<\/code> \u5f62\u5f0f\u7684\u53c2\u6570\u88ab\u4f20\u9012\u7ed9 <code>dict()<\/code> \u51fd\u6570\uff0c\u7ed3\u679c\u4e0e\u4f7f\u7528\u5927\u62ec\u53f7\u521b\u5efa\u7684\u5b57\u5178\u76f8\u540c\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9\uff1a<\/h4>\n<\/p>\n<ul>\n<li><strong>\u7b80\u6d01<\/strong>\uff1a\u9002\u5408\u4ece\u53d8\u91cf\u540d\u521b\u5efa\u5b57\u5178\u3002<\/li>\n<li><strong>\u52a8\u6001\u6027<\/strong>\uff1a\u53ef\u4ee5\u4ece\u5217\u8868\u6216\u5176\u4ed6\u53ef\u8fed\u4ee3\u5bf9\u8c61\u521b\u5efa\u3002<\/li>\n<\/ul>\n<p><h4>\u6ce8\u610f\u4e8b\u9879\uff1a<\/h4>\n<\/p>\n<ul>\n<li>\u952e\u5fc5\u987b\u662f\u6709\u6548\u7684 Python \u6807\u8bc6\u7b26\uff08\u5982\u53d8\u91cf\u540d\uff09\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u4ece\u952e\u503c\u5bf9\u5e8f\u5217\u521b\u5efa<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528 <code>dict()<\/code> \u51fd\u6570\u4ece\u952e\u503c\u5bf9\u5e8f\u5217\u521b\u5efa\u5b57\u5178\uff0c\u6700\u5e38\u89c1\u7684\u662f\u5217\u8868\u6216\u5143\u7ec4\u7ec4\u6210\u7684\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4ece\u952e\u503c\u5bf9\u5e8f\u5217\u521b\u5efa\u5b57\u5178<\/p>\n<p>p<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>rs = [(&#39;name&#39;, &#39;Alice&#39;), (&#39;age&#39;, 25), (&#39;city&#39;, &#39;New York&#39;)]<\/p>\n<p>person = dict(pairs)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7279\u522b\u9002\u5408\u4ece\u5916\u90e8\u6570\u636e\u6e90\uff08\u5982\u6570\u636e\u5e93\u67e5\u8be2\u7ed3\u679c\uff09\u6216\u9700\u8981\u52a8\u6001\u6784\u5efa\u5b57\u5178\u7684\u573a\u5408\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9\uff1a<\/h4>\n<\/p>\n<ul>\n<li><strong>\u7075\u6d3b\u6027<\/strong>\uff1a\u9002\u5408\u52a8\u6001\u751f\u6210\u952e\u503c\u5bf9\u3002<\/li>\n<li><strong>\u7ed3\u6784\u5316\u6570\u636e<\/strong>\uff1a\u4ece\u7ed3\u6784\u5316\u6570\u636e\uff08\u5982\u6570\u636e\u5e93\u6216 CSV \u6587\u4ef6\uff09\u4e2d\u521b\u5efa\u5b57\u5178\u3002<\/li>\n<\/ul>\n<p><h4>\u6ce8\u610f\u4e8b\u9879\uff1a<\/h4>\n<\/p>\n<ul>\n<li>\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u5fc5\u987b\u662f\u4e00\u4e2a\u4e8c\u5143\u7ec4\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u901a\u8fc7\u5b57\u5178\u63a8\u5bfc\u5f0f\u521b\u5efa<\/h3>\n<\/p>\n<p><p>\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u7528\u4e8e\u4ece\u73b0\u6709\u6570\u636e\u521b\u5efa\u5b57\u5178\u3002\u7c7b\u4f3c\u4e8e\u5217\u8868\u63a8\u5bfc\u5f0f\uff0c\u5b57\u5178\u63a8\u5bfc\u5f0f\u5141\u8bb8\u5728\u4e00\u4e2a\u8868\u8fbe\u5f0f\u4e2d\u5bf9\u6bcf\u4e2a\u5143\u7d20\u5e94\u7528\u53d8\u6362\u6216\u6761\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\u521b\u5efa\u5b57\u5178<\/p>\n<p>squares = {x: x*x for x in range(6)}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5b57\u5178 <code>squares<\/code> \u7684\u952e\u662f\u6570\u5b57\uff0c\u503c\u662f\u6570\u5b57\u7684\u5e73\u65b9\u3002<\/p>\n<\/p>\n<p><h4>\u4f18\u70b9\uff1a<\/h4>\n<\/p>\n<ul>\n<li><strong>\u7b80\u6d01<\/strong>\uff1a\u7528\u4e00\u884c\u4ee3\u7801\u521b\u5efa\u590d\u6742\u5b57\u5178\u3002<\/li>\n<li><strong>\u6761\u4ef6\u8fc7\u6ee4<\/strong>\uff1a\u53ef\u4ee5\u5728\u521b\u5efa\u8fc7\u7a0b\u4e2d\u5e94\u7528\u6761\u4ef6\u3002<\/li>\n<\/ul>\n<p><h4>\u6ce8\u610f\u4e8b\u9879\uff1a<\/h4>\n<\/p>\n<ul>\n<li>\u8868\u8fbe\u5f0f\u5fc5\u987b\u751f\u6210\u552f\u4e00\u7684\u952e\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u4ece\u73b0\u6709\u5b57\u5178\u590d\u5236\u6216\u66f4\u65b0<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u590d\u5236\u73b0\u6709\u5b57\u5178\u6216\u6839\u636e\u53e6\u4e00\u4e2a\u5b57\u5178\u66f4\u65b0\u4e00\u4e2a\u5b57\u5178\u3002Python \u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e9b\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>1. \u590d\u5236\u5b57\u5178<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528 <code>copy()<\/code> \u65b9\u6cd5\u6216 <code>dict()<\/code> \u51fd\u6570\u6765\u590d\u5236\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 copy() \u65b9\u6cd5\u590d\u5236\u5b57\u5178<\/p>\n<p>original = {&#39;a&#39;: 1, &#39;b&#39;: 2}<\/p>\n<p>copy_dict = original.copy()<\/p>\n<h2><strong>\u4f7f\u7528 dict() \u51fd\u6570\u590d\u5236\u5b57\u5178<\/strong><\/h2>\n<p>copy_dict = dict(original)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u66f4\u65b0\u5b57\u5178<\/h4>\n<\/p>\n<p><p><code>update()<\/code> \u65b9\u6cd5\u7528\u4e8e\u5c06\u4e00\u4e2a\u5b57\u5178\u7684\u952e\u503c\u5bf9\u6dfb\u52a0\u5230\u53e6\u4e00\u4e2a\u5b57\u5178\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528 update() \u65b9\u6cd5\u66f4\u65b0\u5b57\u5178<\/p>\n<p>dict1 = {&#39;a&#39;: 1, &#39;b&#39;: 2}<\/p>\n<p>dict2 = {&#39;b&#39;: 3, &#39;c&#39;: 4}<\/p>\n<p>dict1.update(dict2)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>dict1<\/code> \u88ab\u66f4\u65b0\u4e3a <code>{&#39;a&#39;: 1, &#39;b&#39;: 3, &#39;c&#39;: 4}<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python \u4e2d\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u6765\u521b\u5efa\u5b57\u5178\uff0c\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u70b9\u548c\u9002\u7528\u573a\u666f\u3002\u4f7f\u7528\u5927\u62ec\u53f7\u662f\u6700\u5e38\u89c1\u7684\u65b9\u5f0f\uff0c\u9002\u5408\u76f4\u63a5\u5b9a\u4e49\u5b57\u5178\uff1b<code>dict()<\/code> \u6784\u9020\u51fd\u6570\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\uff0c\u5c24\u5176\u662f\u5728\u4ece\u53ef\u8fed\u4ee3\u5bf9\u8c61\u521b\u5efa\u5b57\u5178\u65f6\uff1b\u5b57\u5178\u63a8\u5bfc\u5f0f\u63d0\u4f9b\u4e86\u4e00\u79cd\u9ad8\u6548\u7684\u65b9\u6cd5\u6765\u521b\u5efa\u5b57\u5178\uff0c\u5e76\u53ef\u5e94\u7528\u6761\u4ef6\u548c\u53d8\u6362\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u7406\u89e3\u8fd9\u4e9b\u4e0d\u540c\u7684\u65b9\u6cd5\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u6700\u4f73\u7684\u5b57\u5178\u521b\u5efa\u65b9\u5f0f\uff0c\u4ece\u800c\u7f16\u5199\u51fa\u66f4\u9ad8\u6548\u3001\u53ef\u8bfb\u6027\u66f4\u5f3a\u7684\u4ee3\u7801\u3002\u5b57\u5178\u4f5c\u4e3aPython\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\uff0c\u5176\u7075\u6d3b\u6027\u548c\u5f3a\u5927\u7684\u529f\u80fd\u4f7f\u5f97\u5728\u5904\u7406\u590d\u6742\u6570\u636e\u65f6\u6781\u4e3a\u6709\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u82b1\u62ec\u53f7 <code>{}<\/code> \u6216 <code>dict()<\/code> \u51fd\u6570\u6765\u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178\u3002\u4ee5\u4e0b\u662f\u4e24\u79cd\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">empty_dict1 = {}  # \u4f7f\u7528\u82b1\u62ec\u53f7\nempty_dict2 = dict()  # \u4f7f\u7528dict()\u51fd\u6570\n<\/code><\/pre>\n<p>\u8fd9\u4e24\u79cd\u65b9\u5f0f\u90fd\u53ef\u4ee5\u6709\u6548\u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178\uff0c\u60a8\u53ef\u4ee5\u968f\u65f6\u5411\u5176\u4e2d\u6dfb\u52a0\u952e\u503c\u5bf9\u3002<\/p>\n<p><strong>\u5982\u4f55\u5411\u5b57\u5178\u4e2d\u6dfb\u52a0\u952e\u503c\u5bf9\uff1f<\/strong><br \/>\u5411\u5b57\u5178\u4e2d\u6dfb\u52a0\u952e\u503c\u5bf9\u975e\u5e38\u7b80\u5355\u3002\u60a8\u53ea\u9700\u6307\u5b9a\u952e\u5e76\u8d4b\u503c\u7ed9\u5b83\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">my_dict = {}\nmy_dict[&#39;name&#39;] = &#39;Alice&#39;\nmy_dict[&#39;age&#39;] = 25\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2a\u5b57\u5178\uff0c\u5e76\u6dfb\u52a0\u4e86\u4e24\u4e2a\u952e\u503c\u5bf9\uff0c\u5206\u522b\u4e3a &#39;name&#39; \u548c &#39;age&#39;\u3002<\/p>\n<p><strong>Python\u5b57\u5178\u7684\u952e\u53ef\u4ee5\u662f\u4ec0\u4e48\u7c7b\u578b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5b57\u5178\u7684\u952e\u53ef\u4ee5\u662f\u4e0d\u53ef\u53d8\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5982\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u548c\u5143\u7ec4\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5217\u8868\u548c\u5b57\u5178\u7b49\u53ef\u53d8\u7c7b\u578b\u4e0d\u80fd\u4f5c\u4e3a\u952e\uff0c\u56e0\u4e3a\u5b83\u4eec\u7684\u54c8\u5e0c\u503c\u662f\u4e0d\u53ef\u9884\u6d4b\u7684\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">my_dict = {\n    &#39;name&#39;: &#39;Bob&#39;,  # \u5b57\u7b26\u4e32\u4f5c\u4e3a\u952e\n    1: &#39;One&#39;,       # \u6570\u5b57\u4f5c\u4e3a\u952e\n    (1, 2): &#39;Tuple&#39; # \u5143\u7ec4\u4f5c\u4e3a\u952e\n}\n<\/code><\/pre>\n<p>\u4f7f\u7528\u8fd9\u4e9b\u4e0d\u53ef\u53d8\u7c7b\u578b\u4f5c\u4e3a\u952e\uff0c\u53ef\u4ee5\u786e\u4fdd\u5b57\u5178\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u521b\u5efa\u5b57\u5178\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\u5b9e\u73b0\uff0c\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5927\u62ec\u53f7\u3001\u4f7f\u7528dict()\u6784\u9020\u51fd\u6570\u3001\u4ece\u952e [&hellip;]","protected":false},"author":3,"featured_media":981313,"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\/981306"}],"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=981306"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/981306\/revisions"}],"predecessor-version":[{"id":981315,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/981306\/revisions\/981315"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/981313"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=981306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=981306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=981306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}