{"id":1097443,"date":"2025-01-08T15:11:54","date_gmt":"2025-01-08T07:11:54","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1097443.html"},"modified":"2025-01-08T15:11:57","modified_gmt":"2025-01-08T07:11:57","slug":"python%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e6%a0%88%e5%92%8c%e9%98%9f%e5%88%97%e7%9a%84%e8%bd%ac%e6%8d%a2-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1097443.html","title":{"rendered":"python\u5982\u4f55\u4f7f\u7528\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24212215\/24195904-da8b-4edf-8fe5-044a12bc45aa.webp\" alt=\"python\u5982\u4f55\u4f7f\u7528\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u4f7f\u7528\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362\u53ef\u4ee5\u901a\u8fc7\u5185\u7f6e\u7684\u6570\u636e\u7ed3\u6784\u4ee5\u53ca\u4e00\u4e9b\u6807\u51c6\u5e93\u6765\u5b9e\u73b0\uff0c\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528list\u4f5c\u4e3a\u6808\u548c\u961f\u5217\u3001\u5229\u7528collections\u6a21\u5757\u4e2d\u7684deque\u3001\u4f7f\u7528queue\u6a21\u5757\u3002<\/strong> \u5176\u4e2d\uff0c<strong>list\u4f5c\u4e3a\u6808\u548c\u961f\u5217<\/strong> \u662f\u6700\u5e38\u7528\u7684\u4e00\u79cd\u65b9\u6cd5\u3002\u4f7f\u7528list\u65f6\uff0c\u6808\u7684\u64cd\u4f5c\u4f7f\u7528append()\u548cpop()\u65b9\u6cd5\uff0c\u800c\u961f\u5217\u7684\u64cd\u4f5c\u5219\u4f7f\u7528append()\u548cpop(0)\u65b9\u6cd5\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528list\u4f5c\u4e3a\u6808\u548c\u961f\u5217<\/h3>\n<\/p>\n<p><h4>1. \u6808\u7684\u64cd\u4f5c<\/h4>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6808\uff08Stack\uff09\u662f\u4e00\u79cd\u540e\u8fdb\u5148\u51fa\uff08LIFO, Last In First Out\uff09\u7684\u6570\u636e\u7ed3\u6784\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\uff08list\uff09\u6765\u5b9e\u73b0\u6808\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u5305\u62ec\u538b\u6808\uff08push\uff09\u548c\u51fa\u6808\uff08pop\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528list\u5b9e\u73b0\u6808<\/p>\n<p>stack = []<\/p>\n<h2><strong>\u538b\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>stack.append(1)<\/p>\n<p>stack.append(2)<\/p>\n<p>stack.append(3)<\/p>\n<p>print(f&quot;Stack after pushing: {stack}&quot;)<\/p>\n<h2><strong>\u51fa\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>item = stack.pop()<\/p>\n<p>print(f&quot;Item popped: {item}&quot;)<\/p>\n<p>print(f&quot;Stack after popping: {stack}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>append()<\/code>\u65b9\u6cd5\u7528\u4e8e\u538b\u6808\uff0c<code>pop()<\/code>\u65b9\u6cd5\u7528\u4e8e\u51fa\u6808\u3002\u6bcf\u6b21\u8c03\u7528<code>pop()<\/code>\u65b9\u6cd5\u65f6\uff0c\u90fd\u4f1a\u79fb\u9664\u5e76\u8fd4\u56de\u6808\u9876\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h4>2. \u961f\u5217\u7684\u64cd\u4f5c<\/h4>\n<\/p>\n<p><p>\u961f\u5217\uff08Queue\uff09\u662f\u4e00\u79cd\u5148\u8fdb\u5148\u51fa\uff08FIFO, First In First Out\uff09\u7684\u6570\u636e\u7ed3\u6784\u3002\u6211\u4eec\u540c\u6837\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u6765\u5b9e\u73b0\u961f\u5217\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u5305\u62ec\u5165\u961f\uff08enqueue\uff09\u548c\u51fa\u961f\uff08dequeue\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528list\u5b9e\u73b0\u961f\u5217<\/p>\n<p>queue = []<\/p>\n<h2><strong>\u5165\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>queue.append(1)<\/p>\n<p>queue.append(2)<\/p>\n<p>queue.append(3)<\/p>\n<p>print(f&quot;Queue after enqueue: {queue}&quot;)<\/p>\n<h2><strong>\u51fa\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>item = queue.pop(0)<\/p>\n<p>print(f&quot;Item dequeued: {item}&quot;)<\/p>\n<p>print(f&quot;Queue after dequeue: {queue}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>append()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5165\u961f\uff0c<code>pop(0)<\/code>\u65b9\u6cd5\u7528\u4e8e\u51fa\u961f\u3002\u6bcf\u6b21\u8c03\u7528<code>pop(0)<\/code>\u65b9\u6cd5\u65f6\uff0c\u90fd\u4f1a\u79fb\u9664\u5e76\u8fd4\u56de\u961f\u5217\u5934\u90e8\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528collections\u6a21\u5757\u4e2d\u7684deque<\/h3>\n<\/p>\n<p><p><code>collections<\/code>\u6a21\u5757\u4e2d\u7684<code>deque<\/code>\uff08\u53cc\u7aef\u961f\u5217\uff09\u662f\u4e00\u4e2a\u7ebf\u7a0b\u5b89\u5168\u3001\u5185\u5b58\u9ad8\u6548\u7684\u6808\u548c\u961f\u5217\u5b9e\u73b0\u3002\u5b83\u652f\u6301\u5728\u4e24\u7aef\u5feb\u901f\u6dfb\u52a0\u548c\u5220\u9664\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h4>1. \u6808\u7684\u64cd\u4f5c<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import deque<\/p>\n<h2><strong>\u4f7f\u7528deque\u5b9e\u73b0\u6808<\/strong><\/h2>\n<p>stack = deque()<\/p>\n<h2><strong>\u538b\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>stack.append(1)<\/p>\n<p>stack.append(2)<\/p>\n<p>stack.append(3)<\/p>\n<p>print(f&quot;Stack after pushing: {list(stack)}&quot;)<\/p>\n<h2><strong>\u51fa\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>item = stack.pop()<\/p>\n<p>print(f&quot;Item popped: {item}&quot;)<\/p>\n<p>print(f&quot;Stack after popping: {list(stack)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0e\u4f7f\u7528<code>list<\/code>\u5b9e\u73b0\u6808\u7684\u64cd\u4f5c\u7c7b\u4f3c\uff0c<code>deque<\/code>\u4e5f\u4f7f\u7528<code>append()<\/code>\u548c<code>pop()<\/code>\u65b9\u6cd5\u6765\u5b9e\u73b0\u538b\u6808\u548c\u51fa\u6808\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>2. \u961f\u5217\u7684\u64cd\u4f5c<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import deque<\/p>\n<h2><strong>\u4f7f\u7528deque\u5b9e\u73b0\u961f\u5217<\/strong><\/h2>\n<p>queue = deque()<\/p>\n<h2><strong>\u5165\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>queue.append(1)<\/p>\n<p>queue.append(2)<\/p>\n<p>queue.append(3)<\/p>\n<p>print(f&quot;Queue after enqueue: {list(queue)}&quot;)<\/p>\n<h2><strong>\u51fa\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>item = queue.popleft()<\/p>\n<p>print(f&quot;Item dequeued: {item}&quot;)<\/p>\n<p>print(f&quot;Queue after dequeue: {list(queue)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>append()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5165\u961f\uff0c<code>popleft()<\/code>\u65b9\u6cd5\u7528\u4e8e\u51fa\u961f\u3002\u6bcf\u6b21\u8c03\u7528<code>popleft()<\/code>\u65b9\u6cd5\u65f6\uff0c\u90fd\u4f1a\u79fb\u9664\u5e76\u8fd4\u56de\u961f\u5217\u5934\u90e8\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528queue\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>queue<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u540c\u6b65\u7684\u3001\u7ebf\u7a0b\u5b89\u5168\u7684\u961f\u5217\u7c7b\uff0c\u5305\u62ec<code>Queue<\/code>\uff08FIFO\u961f\u5217\uff09\u3001<code>LifoQueue<\/code>\uff08LIFO\u961f\u5217\uff09\u548c<code>PriorityQueue<\/code>\uff08\u4f18\u5148\u7ea7\u961f\u5217\uff09\u3002<\/p>\n<\/p>\n<p><h4>1. \u6808\u7684\u64cd\u4f5c\uff08\u4f7f\u7528LifoQueue\uff09<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from queue import LifoQueue<\/p>\n<h2><strong>\u4f7f\u7528LifoQueue\u5b9e\u73b0\u6808<\/strong><\/h2>\n<p>stack = LifoQueue()<\/p>\n<h2><strong>\u538b\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>stack.put(1)<\/p>\n<p>stack.put(2)<\/p>\n<p>stack.put(3)<\/p>\n<p>print(f&quot;Stack size after pushing: {stack.qsize()}&quot;)<\/p>\n<h2><strong>\u51fa\u6808\u64cd\u4f5c<\/strong><\/h2>\n<p>item = stack.get()<\/p>\n<p>print(f&quot;Item popped: {item}&quot;)<\/p>\n<p>print(f&quot;Stack size after popping: {stack.qsize()}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>put()<\/code>\u65b9\u6cd5\u7528\u4e8e\u538b\u6808\uff0c<code>get()<\/code>\u65b9\u6cd5\u7528\u4e8e\u51fa\u6808\u3002\u6bcf\u6b21\u8c03\u7528<code>get()<\/code>\u65b9\u6cd5\u65f6\uff0c\u90fd\u4f1a\u79fb\u9664\u5e76\u8fd4\u56de\u6808\u9876\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h4>2. \u961f\u5217\u7684\u64cd\u4f5c\uff08\u4f7f\u7528Queue\uff09<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from queue import Queue<\/p>\n<h2><strong>\u4f7f\u7528Queue\u5b9e\u73b0\u961f\u5217<\/strong><\/h2>\n<p>queue = Queue()<\/p>\n<h2><strong>\u5165\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>queue.put(1)<\/p>\n<p>queue.put(2)<\/p>\n<p>queue.put(3)<\/p>\n<p>print(f&quot;Queue size after enqueue: {queue.qsize()}&quot;)<\/p>\n<h2><strong>\u51fa\u961f\u64cd\u4f5c<\/strong><\/h2>\n<p>item = queue.get()<\/p>\n<p>print(f&quot;Item dequeued: {item}&quot;)<\/p>\n<p>print(f&quot;Queue size after dequeue: {queue.qsize()}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>put()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5165\u961f\uff0c<code>get()<\/code>\u65b9\u6cd5\u7528\u4e8e\u51fa\u961f\u3002\u6bcf\u6b21\u8c03\u7528<code>get()<\/code>\u65b9\u6cd5\u65f6\uff0c\u90fd\u4f1a\u79fb\u9664\u5e76\u8fd4\u56de\u961f\u5217\u5934\u90e8\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u6808\u8f6c\u6362\u4e3a\u961f\u5217\uff0c\u6216\u5c06\u961f\u5217\u8f6c\u6362\u4e3a\u6808\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5c06\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\u4e2d\u7684\u5143\u7d20\u9010\u4e00\u8f6c\u79fb\u5230\u53e6\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\u4e2d\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h4>1. \u6808\u8f6c\u6362\u4e3a\u961f\u5217<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528list\u5b9e\u73b0\u6808\u548c\u961f\u5217<\/p>\n<p>stack = [1, 2, 3]<\/p>\n<h2><strong>\u5c06\u6808\u8f6c\u6362\u4e3a\u961f\u5217<\/strong><\/h2>\n<p>queue = []<\/p>\n<p>while stack:<\/p>\n<p>    queue.append(stack.pop())<\/p>\n<p>print(f&quot;Queue after conversion: {queue}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9010\u4e00\u5f39\u51fa\u6808\u9876\u5143\u7d20\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u961f\u5217\u4e2d\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86\u6808\u5230\u961f\u5217\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h4>2. \u961f\u5217\u8f6c\u6362\u4e3a\u6808<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528list\u5b9e\u73b0\u961f\u5217\u548c\u6808<\/p>\n<p>queue = [1, 2, 3]<\/p>\n<h2><strong>\u5c06\u961f\u5217\u8f6c\u6362\u4e3a\u6808<\/strong><\/h2>\n<p>stack = []<\/p>\n<p>while queue:<\/p>\n<p>    stack.append(queue.pop(0))<\/p>\n<p>print(f&quot;Stack after conversion: {stack}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9010\u4e00\u5f39\u51fa\u961f\u5217\u5934\u90e8\u5143\u7d20\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u6808\u4e2d\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86\u961f\u5217\u5230\u6808\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u65b9\u4fbf\u5730\u4f7f\u7528\u6808\u548c\u961f\u5217\uff0c\u5e76\u8fdb\u884c\u6808\u548c\u961f\u5217\u4e4b\u95f4\u7684\u8f6c\u6362\u3002<strong>\u4f7f\u7528list\u4f5c\u4e3a\u6808\u548c\u961f\u5217\u3001\u5229\u7528collections\u6a21\u5757\u4e2d\u7684deque\u3001\u4f7f\u7528queue\u6a21\u5757<\/strong> \u662f\u5b9e\u73b0\u8fd9\u4e9b\u64cd\u4f5c\u7684\u4e3b\u8981\u65b9\u6cd5\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u9ad8\u6548\u5730\u5904\u7406\u6570\u636e\u7ed3\u6784\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6808\u53ef\u4ee5\u901a\u8fc7\u5217\u8868\u6765\u5b9e\u73b0\uff0c\u4f7f\u7528append()\u548cpop()\u65b9\u6cd5\u8fdb\u884c\u5143\u7d20\u7684\u6dfb\u52a0\u548c\u5220\u9664\u3002\u961f\u5217\u5219\u53ef\u4ee5\u4f7f\u7528collections\u6a21\u5757\u4e2d\u7684deque\uff0c\u63d0\u4f9b\u4e86append()\u548cpopleft()\u65b9\u6cd5\u3002\u8981\u5b9e\u73b0\u6808\u4e0e\u961f\u5217\u4e4b\u95f4\u7684\u8f6c\u6362\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u6808\u7684\u5143\u7d20\u9010\u4e2a\u5f39\u51fa\u5e76\u52a0\u5165\u5230\u961f\u5217\u4e2d\uff0c\u6216\u8005\u5c06\u961f\u5217\u7684\u5143\u7d20\u9010\u4e2a\u51fa\u961f\u5e76\u52a0\u5165\u5230\u6808\u4e2d\u6765\u5b9e\u73b0\u3002<\/p>\n<p><strong>\u6808\u548c\u961f\u5217\u7684\u5177\u4f53\u5e94\u7528\u573a\u666f\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u6808\u9002\u5408\u7528\u4e8e\u9700\u8981\u540e\u8fdb\u5148\u51fa\uff08LIFO\uff09\u64cd\u4f5c\u7684\u573a\u666f\uff0c\u4f8b\u5982\u51fd\u6570\u8c03\u7528\u7684\u7ba1\u7406\u3001\u8868\u8fbe\u5f0f\u6c42\u503c\u548c\u62ec\u53f7\u5339\u914d\u7b49\u3002\u800c\u961f\u5217\u5219\u9002\u5408\u7528\u4e8e\u9700\u8981\u5148\u8fdb\u5148\u51fa\uff08FIFO\uff09\u64cd\u4f5c\u7684\u573a\u666f\uff0c\u4f8b\u5982\u4efb\u52a1\u8c03\u5ea6\u3001\u6253\u5370\u4efb\u52a1\u7ba1\u7406\u548c\u6570\u636e\u7f13\u51b2\u7b49\u3002\u4e86\u89e3\u8fd9\u4e9b\u5e94\u7528\u573a\u666f\u6709\u52a9\u4e8e\u66f4\u597d\u5730\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u4f7f\u7528\u6808\u548c\u961f\u5217\u65f6\uff0c\u6709\u54ea\u4e9b\u6027\u80fd\u8003\u8651\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5217\u8868\u4f5c\u4e3a\u6808\u7684\u5b9e\u73b0\u65f6\uff0c\u4f7f\u7528append()\u548cpop()\u64cd\u4f5c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aO(1)\u3002\u7136\u800c\uff0c\u4f7f\u7528\u5217\u8868\u4f5c\u4e3a\u961f\u5217\u65f6\uff0c\u4f7f\u7528pop(0)\u64cd\u4f5c\u4f1a\u5bfc\u81f4O(n)\u7684\u65f6\u95f4\u590d\u6742\u5ea6\uff0c\u56e0\u6b64\u63a8\u8350\u4f7f\u7528collections.deque\u4f5c\u4e3a\u961f\u5217\u5b9e\u73b0\uff0c\u5b83\u63d0\u4f9b\u4e86O(1)\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u6765\u8fdb\u884c\u961f\u5217\u64cd\u4f5c\u3002\u5728\u9009\u62e9\u6570\u636e\u7ed3\u6784\u65f6\uff0c\u6027\u80fd\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u8003\u8651\u56e0\u7d20\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u4f7f\u7528\u6808\u548c\u961f\u5217\u7684\u8f6c\u6362\u53ef\u4ee5\u901a\u8fc7\u5185\u7f6e\u7684\u6570\u636e\u7ed3\u6784\u4ee5\u53ca\u4e00\u4e9b\u6807\u51c6\u5e93\u6765\u5b9e\u73b0\uff0c\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528list\u4f5c\u4e3a [&hellip;]","protected":false},"author":3,"featured_media":1097444,"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\/1097443"}],"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=1097443"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097443\/revisions"}],"predecessor-version":[{"id":1097446,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097443\/revisions\/1097446"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1097444"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1097443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1097443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1097443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}