{"id":173,"date":"2026-03-31T17:59:08","date_gmt":"2026-03-31T09:59:08","guid":{"rendered":"https:\/\/blog.mumudlin.com\/?p=173"},"modified":"2026-03-31T18:14:04","modified_gmt":"2026-03-31T10:14:04","slug":"basic_grammar","status":"publish","type":"post","link":"https:\/\/blog.mumudlin.com\/index.php\/basic_grammar\/","title":{"rendered":"Python\u7684\u4f5c\u7528\u57df\u4e0e\u7f29\u8fdb"},"content":{"rendered":"<h1>&diams; Python \u6838\u5fc3\u57fa\u77f3\uff1a\u6df1\u5ea6\u89e3\u6790\u7f29\u8fdb\u4e0e\u4f5c\u7528\u57df<\/h1>\n<p>\u5728 Python \u7684\u4e16\u754c\u91cc\uff0c\u4ee3\u7801\u7684<strong>\u7269\u7406\u5f62\u6001<\/strong>\uff08\u7f29\u8fdb\uff09\u76f4\u63a5\u51b3\u5b9a\u4e86\u5b83\u7684<strong>\u903b\u8f91\u8fd0\u884c<\/strong>\uff08\u4f5c\u7528\u57df\uff09\u3002\u8fd9\u4e0e\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\uff08\u5982 Java\u3001C++\uff09\u7528\u5927\u62ec\u53f7 <code>{}<\/code> \u533a\u5206\u4ee3\u7801\u5757\u7684\u65b9\u5f0f\u622a\u7136\u4e0d\u540c\u3002\u7406\u89e3\u8fd9\u4e00\u70b9\uff0c\u662f\u638c\u63e1 Python \u7684\u7b2c\u4e00\u6b65\u3002<\/p>\n<h2>1. \u4ee3\u7801\u7684\u9aa8\u9abc\uff1a\u7f29\u8fdb (Indentation)<\/h2>\n<p>\u5728 Python \u4e2d\uff0c\u7f29\u8fdb\u4e0d\u4ec5\u4ec5\u662f\u201c\u4e3a\u4e86\u597d\u770b\u201d\uff0c\u5b83\u662f<strong>\u8bed\u6cd5\u7684\u4e00\u90e8\u5206<\/strong>\u3002<\/p>\n<ul>\n<li><strong>\u6807\u51c6\u89c4\u8303\uff1a<\/strong> \u5b98\u65b9 PEP 8 \u89c4\u8303\u5efa\u8bae\u4f7f\u7528 <strong>4 \u4e2a\u7a7a\u683c<\/strong>\u4f5c\u4e3a\u4e00\u4e2a\u7f29\u8fdb\u5c42\u7ea7\u3002<\/li>\n<li><strong>\u6280\u672f\u672c\u8d28\uff1a<\/strong> \u867d\u7136 Python \u89e3\u91ca\u5668\u5141\u8bb8\u5927\u4e8e\u7b49\u4e8e\u4e00\u4e2a\u7a7a\u683c\u4f5c\u4e3a\u6709\u6548\u7f29\u8fdb\uff0c\u4f46\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c<strong>\u8bf7\u52a1\u5fc5\u7edf\u4e00\u4f7f\u7528 4 \u4e2a\u7a7a\u683c<\/strong>\uff08\u7edd\u5927\u591a\u6570\u7f16\u8f91\u5668\u4f1a\u5c06 Tab \u952e\u81ea\u52a8\u8f6c\u6362\u4e3a 4 \u4e2a\u7a7a\u683c\uff09\u3002<\/li>\n<li><strong>\u4e25\u7981\u6df7\u7528\uff1a<\/strong> \u7edd\u5bf9\u4e0d\u80fd\u5728\u540c\u4e00\u6587\u4ef6\u4e2d\u6df7\u7528 Tab \u548c\u7a7a\u683c\uff0c\u5426\u5219\u4f1a\u629b\u51fa <code>IndentationError<\/code>\u3002<strong>\uff08\u73b0\u6709\u7684\u901a\u7528\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u975eidle\uff0c\u901a\u5e38\u4f1a\u628aTab\u81ea\u52a8\u8f6c\u6362\u4e3a\u56db\u4e2a\u7a7a\u683c\uff0c\u6216\u8005Tab\u4e3a\u56db\u4e2a\u7a7a\u683c\u7684\u5feb\u6377\u952e\uff0cidle\u4e0d\u652f\u6301\u8f6c\u6362\uff09<\/strong><\/li>\n<\/ul>\n<p><strong>\ud83d\udca1 \u4e3a\u4ec0\u4e48\u9700\u8981\u7f29\u8fdb\uff1f<\/strong><br \/>\nPython \u6ca1\u6709 <code>{}<\/code>\uff0c\u5b83\u7528\u7f29\u8fdb\u6765\u8868\u793a\u201c\u4ee3\u7801\u5757\u7684\u5f52\u5c5e\u201d\u3002\u4f8b\u5982\uff0c\u5728 <code>if<\/code>\u3001<code>for<\/code>\u3001<code>while<\/code> \u6216 <code>def<\/code> \u4e4b\u540e\uff0c\u7f29\u8fdb\u7684\u4ee3\u7801\u90fd\u5c5e\u4e8e\u8fd9\u4e2a\u903b\u8f91\u5757\u3002<\/p>\n<blockquote>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u867d\u7136\u4e0b\u9762\u7684\u4ee3\u7801\u5728\u8bed\u6cd5\u4e0a\u90fd\u80fd\u8fd0\u884c\uff0c\u4f46\u53ea\u6709\u7b2c\u4e00\u79cd\u662f\u7b26\u5408\u89c4\u8303\u7684\u3002<\/p>\n<\/blockquote>\n<pre><code class=\"language-python\"># \u2705 \u63a8\u8350\uff1a\u6807\u51c6\u7f29\u8fdb (4\u4e2a\u7a7a\u683c)\nfor i in range(5):\n    print(i) \n\n# \u26a0\ufe0f \u8b66\u544a\uff1a\u867d\u7136\u80fd\u8fd0\u884c\uff0c\u4f46\u4e0d\u7b26\u5408\u89c4\u8303 (2\u4e2a\u7a7a\u683c)\nfor i in range(5):\n  print(i) \n\n# \u274c \u4e0d\u63a8\u8350\uff1a\u867d\u7136\u80fd\u8fd0\u884c\uff0c\u4f46\u6781\u5176\u6df7\u4e71 (\u5927\u91cf\u7a7a\u683c)\nfor i in range(5):\n                              print(i) <\/code><\/pre>\n<h2>2. \u53d8\u91cf\u7684\u9886\u5730\uff1a\u4f5c\u7528\u57df (Scope)<\/h2>\n<p>\u5982\u679c\u8bf4\u7f29\u8fdb\u662f\u4ee3\u7801\u7684\u201c\u7269\u7406\u56f4\u5899\u201d\uff0c\u90a3\u4e48\u4f5c\u7528\u57df\u5c31\u662f\u53d8\u91cf\u7684\u201c\u6d3b\u52a8\u9886\u5730\u201d\u3002\u5728 Python \u4e2d\uff0c<strong>\u7f29\u8fdb\u5212\u5206\u4e86\u4f5c\u7528\u57df\u7684\u8fb9\u754c<\/strong>\u3002<\/p>\n<p>Python \u9075\u5faa <strong>LEGB<\/strong> \u539f\u5219\u6765\u67e5\u627e\u53d8\u91cf\uff1a<\/p>\n<ol>\n<li><strong>L (Local)<\/strong>\uff1a\u5c40\u90e8\u4f5c\u7528\u57df\uff0c\u5373\u51fd\u6570\u5185\u90e8\u3002<\/li>\n<li><strong>E (Enclosing)<\/strong>\uff1a\u95ed\u5305\u51fd\u6570\u5916\u7684\u51fd\u6570\u4e2d\uff08\u5d4c\u5957\u51fd\u6570\uff09\u3002<\/li>\n<li><strong>G (Global)<\/strong>\uff1a\u5168\u5c40\u4f5c\u7528\u57df\uff0c\u5373\u6a21\u5757\u7ea7\u522b\u3002<\/li>\n<li><strong>B (Built-in)<\/strong>\uff1a\u5185\u7f6e\u4f5c\u7528\u57df\uff0c\u5982 <code>print<\/code>, <code>len<\/code> \u7b49\u3002<\/li>\n<\/ol>\n<hr \/>\n<h2>3. \u6df1\u5ea6\u89e3\u6790\uff1a\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u5faa\u73af\u5916\u80fd\u7528\u53d8\u91cf\uff0c\u6709\u65f6\u5019\u5374\u62a5\u9519\uff1f<\/h2>\n<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u7ecf\u5178\u7684 Python \u201c\u9677\u9631\u201d\u3002\u6211\u4eec\u901a\u8fc7\u4f60\u63d0\u4f9b\u7684\u6848\u4f8b\u6765\u6df1\u5165\u5256\u6790\u3002<\/p>\n<p><strong>\u573a\u666f\u4e00\uff1a\u5faa\u73af\u6b63\u5e38\u6267\u884c<\/strong><\/p>\n<pre><code class=\"language-python\">def main():\n    num = 5\n    for i in range(num):\n        b = 20\n        print(i) # \u8f93\u51fa 0, 1, 2, 3, 4\n    print(b) # \u8f93\u51fa 20\n\nmain()<\/code><\/pre>\n<p><strong>\u7ed3\u679c\uff1a<\/strong> \u4ee3\u7801\u6b63\u5e38\u8fd0\u884c\u3002<br \/>\n<strong>\u539f\u56e0\uff1a<\/strong> <code>num<\/code> \u4e3a 5\uff0c\u5faa\u73af\u6267\u884c\u4e86 5 \u6b21\u3002\u5728\u7b2c\u4e00\u6b21\u5faa\u73af\u4e2d\uff0c\u53d8\u91cf <code>b<\/code> \u88ab\u5b9a\u4e49\u5e76\u8d4b\u503c\u4e3a 20\u3002\u5728 Python \u4e2d\uff0c<strong><code>for<\/code> \u5faa\u73af\u5e76\u4e0d\u4f1a\u521b\u5efa\u65b0\u7684\u4f5c\u7528\u57df<\/strong>\uff08\u8fd9\u4e0e Java \u7b49\u8bed\u8a00\u4e0d\u540c\uff09\u3002\u53d8\u91cf <code>b<\/code> \u5b9e\u9645\u4e0a\u662f\u5b9a\u4e49\u5728 <code>main()<\/code> \u51fd\u6570\u7684\u4f5c\u7528\u57df\uff08Local\uff09\u4e2d\u7684\u3002\u56e0\u6b64\uff0c\u5faa\u73af\u7ed3\u675f\u540e\uff0c<code>b<\/code> \u4f9d\u7136\u5b58\u5728\uff0c\u53ef\u4ee5\u88ab\u6253\u5370\u3002<\/p>\n<p><strong>\u573a\u666f\u4e8c\uff1a\u5faa\u73af\u672a\u6267\u884c<\/strong><\/p>\n<pre><code class=\"language-python\">def main():\n    num = 0 # \u4fee\u6539\u6b64\u5904\n    for i in range(num): # range(0) \u662f\u7a7a\u7684\uff0c\u5faa\u73af\u4f53\u6839\u672c\u4e0d\u4f1a\u8fdb\u5165\n        b = 20 # \u8fd9\u884c\u4ee3\u7801\u4ece\u672a\u6267\u884c\n        print(i)\n    print(b) # \u62a5\u9519\uff01\n\nmain()<\/code><\/pre>\n<p><strong>\u7ed3\u679c\uff1a<\/strong> \u629b\u51fa <code>UnboundLocalError<\/code>\u3002<\/p>\n<pre><code>Traceback (most recent call last):\n  File &quot;D:\\Project\\PythonTemp\\main.py&quot;, line 20, in &lt;module&gt;\n    main()\n  File &quot;D:\\Project\\PythonTemp\\main.py&quot;, line 16, in main\n    print(b)\nUnboundLocalError: local variable &#039;b&#039; referenced before assignment<\/code><\/pre>\n<p><strong>\u539f\u56e0\u5206\u6790\uff1a<\/strong><\/p>\n<ol>\n<li><strong>\u903b\u8f91\u6d41\u7a0b\uff1a<\/strong> <code>range(0)<\/code> \u4ea7\u751f\u4e00\u4e2a\u7a7a\u5e8f\u5217\uff0c<code>for<\/code> \u5faa\u73af\u7684\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c\u76f4\u63a5\u8df3\u8fc7\u5faa\u73af\u4f53\u3002<\/li>\n<li><strong>\u53d8\u91cf\u5b9a\u4e49\uff1a<\/strong> \u56e0\u4e3a\u5faa\u73af\u4f53\u4ece\u672a\u8fd0\u884c\uff0c\u6240\u4ee5 <code>b = 20<\/code> \u8fd9\u884c\u4ee3\u7801\u4ece\u672a\u88ab\u6267\u884c\u3002<\/li>\n<li><strong>\u62a5\u9519\u672c\u8d28\uff1a<\/strong> \u5f53\u89e3\u91ca\u5668\u8fd0\u884c\u5230 <code>print(b)<\/code> \u65f6\uff0c\u5b83\u5728\u5f53\u524d\u7684\u5c40\u90e8\u4f5c\u7528\u57df\uff08<code>main<\/code> \u51fd\u6570\u5185\uff09\u5bfb\u627e\u53d8\u91cf <code>b<\/code>\uff0c\u4f46\u53d1\u73b0\u5b83\u4ece\u672a\u88ab\u5b9a\u4e49\uff08Assignment\uff09\u3002\u8fd9\u5c31\u5bfc\u81f4\u4e86\u62a5\u9519\uff1a<code>local variable &#039;b&#039; referenced before assignment<\/code>\uff08\u5c40\u90e8\u53d8\u91cf 'b' \u5728\u8d4b\u503c\u524d\u88ab\u5f15\u7528\uff09\u3002<\/li>\n<\/ol>\n<h2>4. \u5173\u952e\u8865\u5145\uff1aPython \u7684\u4f5c\u7528\u57df\u89c4\u5219 (The &quot;Textbook&quot; View)<\/h2>\n<p>\u867d\u7136\u4e0a\u9762\u7684\u4f8b\u5b50\u5c55\u793a\u4e86\u201c\u5faa\u73af\u5916\u80fd\u8bbf\u95ee\u5faa\u73af\u5185\u53d8\u91cf\u201d\u7684\u73b0\u8c61\uff0c\u4f46\u5728\u6807\u51c6\u7684 Python \u6559\u5b66\u548c\u4e25\u683c\u7684\u4ee3\u7801\u89c4\u8303\u4e2d\uff0c\u6211\u4eec\u5e94\u8be5\u9075\u5faa\u4ee5\u4e0b\u539f\u5219\uff1a<\/p>\n<ul>\n<li><strong>\u51fd\u6570\u662f\u4f5c\u7528\u57df\u7684\u5206\u6c34\u5cad\uff1a<\/strong> \u53d8\u91cf\u5728\u51fd\u6570\u5185\u90e8\u5b9a\u4e49\uff0c\u901a\u5e38\u53ea\u80fd\u5728\u51fd\u6570\u5185\u90e8\u4f7f\u7528\u3002<\/li>\n<li><strong>\u5168\u5c40\u53d8\u91cf\uff1a<\/strong> \u5728\u51fd\u6570\u5916\u90e8\u5b9a\u4e49\u7684\u53d8\u91cf\u662f\u5168\u5c40\u53d8\u91cf\uff0c\u53ef\u4ee5\u5728\u4efb\u4f55\u5730\u65b9\u8bfb\u53d6\uff08\u4f46\u8981\u5728\u51fd\u6570\u5185\u4fee\u6539\u9700\u7528 <code>global<\/code> \u5173\u952e\u5b57\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre><code class=\"language-python\">x = 10 # \u5168\u5c40\u53d8\u91cf (Global)\n\ndef func():\n    y = 5 # \u5c40\u90e8\u53d8\u91cf (Local)\n    print(x) # \u53ef\u4ee5\u8bbf\u95ee\u5168\u5c40\u53d8\u91cf\n    print(y)\n\nfunc()\n# print(y) # \u8fd9\u91cc\u4f1a\u62a5\u9519\uff0cNameError: name &#039;y&#039; is not defined<\/code><\/pre>\n<h2>5. \u603b\u7ed3\u4e0e\u5efa\u8bae<\/h2>\n<ol>\n<li>\n<p><strong>\u7f29\u8fdb\u89c4\u8303\uff1a<\/strong> \u575a\u6301\u4f7f\u7528 <strong>4 \u4e2a\u7a7a\u683c<\/strong>\uff0c\u4e0d\u8981\u6df7\u7528 Tab \u548c\u7a7a\u683c\u3002\u8fd9\u662f Python \u793e\u533a\u7684\u901a\u7528\u8bed\u8a00\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f5c\u7528\u57df\u610f\u8bc6\uff1a<\/strong> \u867d\u7136 Python \u7684 <code>for<\/code> \u5faa\u73af\u4e0d\u4f1a\u50cf C \u8bed\u8a00\u90a3\u6837\u9650\u5236\u53d8\u91cf\u4f5c\u7528\u57df\uff0c\u4f46<strong>\u4e0d\u8981\u4f9d\u8d56\u8fd9\u79cd\u7279\u6027<\/strong>\u3002\u5728\u5faa\u73af\u4e2d\u5b9a\u4e49\u7684\u53d8\u91cf\uff0c\u5e94\u5f53\u88ab\u89c6\u4e3a\u201c\u5faa\u73af\u76f8\u5173\u53d8\u91cf\u201d\uff0c\u5c3d\u91cf\u907f\u514d\u5728\u5faa\u73af\u5916\u90e8\u76f4\u63a5\u4f7f\u7528\uff0c\u9664\u975e\u4f60\u660e\u786e\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48\uff08\u5982\u7d2f\u52a0\u8ba1\u6570\u5668\uff09\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u521d\u59cb\u5316\u53d8\u91cf\uff1a<\/strong> \u4e3a\u4e86\u907f\u514d <code>UnboundLocalError<\/code>\uff0c\u5982\u679c\u4e00\u4e2a\u53d8\u91cf\u53ef\u80fd\u5728\u67d0\u4e9b\u6761\u4ef6\u4e0b\u4e0d\u88ab\u5b9a\u4e49\uff0c\u6700\u597d\u5728\u4f7f\u7528\u524d\u8fdb\u884c\u521d\u59cb\u5316\u3002<\/p>\n<pre><code class=\"language-python\"># \u6539\u8fdb\u5199\u6cd5\uff1a\u5148\u521d\u59cb\u5316\nb = None \nfor i in range(num):\n   b = 20\n   ...\nprint(b) # \u5373\u4f7f\u5faa\u73af\u6ca1\u8dd1\uff0cb \u4e5f\u662f None\uff0c\u4e0d\u4f1a\u62a5\u9519<\/code><\/pre>\n<p><strong>\u5ef6\u4f38\u9605\u8bfb\uff1a<\/strong><\/p>\n<\/li>\n<\/ol>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/pep8.org\/\">Python \u5b98\u65b9 PEP 8 \u7f16\u7801\u89c4\u8303<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.w3cschool.cn\/python3\/python3-basic-syntax.html\">Python3 \u57fa\u7840\u8bed\u6cd5 - w3cschool<\/a><\/li>\n<\/ul>\n<h2>AI\u751f\u6210\u901a\u4fd7\u89e3\u91ca<\/h2>\n<p>\u6211\u4eec\u7528\u4e00\u4e2a\u751f\u6d3b\u4f8b\u5b50\u6765\u7406\u89e3Python\u7684\u7f29\u8fdb\u3002<\/p>\n<p><strong>\u60f3\u8c61\u4f60\u5728\u5199\u4e00\u4efd\u201c\u5bb6\u52a1\u5206\u5de5\u6e05\u5355\u201d<\/strong>\uff1a<\/p>\n<blockquote>\n<p>\u5982\u679c\u4eca\u5929\u662f\u5468\u672b\uff1a  <\/p>\n<ul>\n<li>\u62d6\u5730  <\/li>\n<li>\u64e6\u7a97\u6237\n<ul>\n<li>\u6ce8\u610f\uff1a\u5148\u55b7\u6e05\u6d01\u5242  <\/li>\n<li>\u518d\u7528\u6e7f\u5e03\u64e6  <\/li>\n<\/ul>\n<\/li>\n<li>\u5012\u5783\u573e  <\/li>\n<\/ul>\n<\/blockquote>\n<p>\u4f60\u770b\uff0c\u8fd9\u4e9b <strong>\u5f00\u5934\u7684\u7a7a\u683c<\/strong> \u5c31\u8868\u793a\u4e86\u201c\u8c01\u5f52\u8c01\u7ba1\u201d\uff1a<\/p>\n<ul>\n<li>\u201c\u62d6\u5730\u201d\u524d\u9762\u6709\u7a7a\u683c\uff0c\u8bf4\u660e\u5b83\u5c5e\u4e8e\u201c\u5982\u679c\u5468\u672b\u201d\u8fd9\u4e2a\u6761\u4ef6\u91cc\u3002<\/li>\n<li>\u201c\u6ce8\u610f\u201d\u524d\u9762\u6709<strong>\u66f4\u591a\u7a7a\u683c<\/strong>\uff0c\u8bf4\u660e\u5b83\u5c5e\u4e8e\u201c\u64e6\u7a97\u6237\u201d\u8fd9\u4e00\u9879\u91cc\u3002<\/li>\n<\/ul>\n<hr \/>\n<p><strong>Python\u91cc\u7684\u7f29\u8fdb\u5c31\u662f\u8fd9\u4e2a\u9053\u7406<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>\u4e0d\u9700\u8981\u82b1\u62ec\u53f7 <code>{}<\/code><\/strong>\uff0c\u53ea\u7528<strong>\u884c\u9996\u7684\u7a7a\u683c\u6216Tab<\/strong>\u6765\u8868\u793a\u4ee3\u7801\u7684\u5c42\u7ea7\u5173\u7cfb\u3002<\/li>\n<li>\u5c5e\u4e8e\u540c\u4e00\u4e2a\u201c\u4e0a\u7ea7\u201d\u7684\u4ee3\u7801\uff0c\u5fc5\u987b<strong>\u7f29\u8fdb\u76f8\u540c<\/strong>\u3002<\/li>\n<\/ul>\n<p><strong>\u4e3e\u4f8b<\/strong>\uff1a<\/p>\n<pre><code class=\"language-python\">if \u4eca\u5929\u662f\u5468\u672b:\n    \u62d6\u5730()\n    \u64e6\u7a97\u6237()\n    \u5012\u5783\u573e()<\/code><\/pre>\n<ul>\n<li>\u4e09\u4e2a\u4efb\u52a1\u7f29\u8fdb\u76f8\u540c\uff0c\u90fd\u5c5e\u4e8e<code>if<\/code>\u6761\u4ef6\u6ee1\u8db3\u65f6\u8981\u505a\u7684\u3002<\/li>\n<li>\u5982\u679c\u4f60\u628a<code>\u5012\u5783\u573e()<\/code>\u7684\u7f29\u8fdb\u5220\u6389\uff0cPython\u5c31\u4e0d\u77e5\u9053\u5b83\u8be5\u542c\u8c01\u7684\uff0c\u4f1a\u76f4\u63a5\u62a5\u9519\u3002<\/li>\n<\/ul>\n<p><strong>\u5e38\u89c1\u7684\u5751<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>\u6df7\u7528\u7a7a\u683c\u548cTab<\/strong> \u2192 \u53ef\u80fd\u62a5\u9519\uff08\u5efa\u8bae\u7edf\u4e00\u75284\u4e2a\u7a7a\u683c\uff09<\/li>\n<li><strong>\u8be5\u7f29\u8fdb\u65f6\u4e0d\u7f29\u8fdb<\/strong> \u2192 \u62a5\u9519<\/li>\n<li><strong>\u591a\u7f29\u6216\u5c11\u7f29\u4e00\u4e2a\u7a7a\u683c<\/strong> \u2192 \u62a5\u9519<\/li>\n<\/ul>\n<p><strong>\u8bb0\u4f4f\u4e00\u53e5\u8bdd<\/strong>\uff1a  <\/p>\n<blockquote>\n<p>\u5728Python\u91cc\uff0c<strong>\u7f29\u8fdb\u4e0d\u662f\u4e3a\u4e86\u8ba9\u4ee3\u7801\u597d\u770b\uff0c\u800c\u662f\u8bed\u6cd5\u7684\u4e00\u90e8\u5206<\/strong>\u3002\u5c31\u50cf\u5199\u6587\u7ae0\u4e0d\u80fd\u4e71\u6362\u884c\u4e00\u6837\uff0c\u7f29\u8fdb\u9519\u4e86\uff0c\u7a0b\u5e8f\u5c31\u8dd1\u4e0d\u8d77\u6765\u3002<\/p>\n<\/blockquote>\n<p>\u521a\u5f00\u59cb\u5199\u4ee3\u7801\u65f6\uff0c\u7528\u4e2a\u597d\u70b9\u7684\u7f16\u8f91\u5668\uff08\u6bd4\u5982VS Code\u3001PyCharm\uff09\uff0c\u5b83\u4f1a\u81ea\u52a8\u5e2e\u4f60\u7ba1\u7406\u7f29\u8fdb\uff0c\u5f88\u5c11\u4f1a\u51fa\u9519\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&diams; Python \u6838\u5fc3\u57fa\u77f3\uff1a\u6df1\u5ea6\u89e3\u6790\u7f29\u8fdb\u4e0e\u4f5c\u7528\u57df \u5728 Python \u7684\u4e16\u754c\u91cc\uff0c\u4ee3\u7801\u7684\u7269\u7406\u5f62\u6001\uff08\u7f29\u8fdb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-13"],"_links":{"self":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":17,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/173\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}