{"id":648,"date":"2019-09-16T18:12:24","date_gmt":"2019-09-16T10:12:24","guid":{"rendered":"http:\/\/vip.fxxkpython.com\/?p=648"},"modified":"2021-08-28T16:16:36","modified_gmt":"2021-08-28T08:16:36","slug":"python%e5%bf%ab%e9%80%9f%e5%85%a5%e9%97%a8-python-%e5%87%bd%e6%95%b0%e4%b8%ad%e7%9a%84%e9%82%a3%e4%ba%9b%e5%8f%82%e6%95%b0%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=648","title":{"rendered":"Python\u5feb\u901f\u5165\u95e8 | Python \u51fd\u6570\u4e2d\u7684\u90a3\u4e9b\u53c2\u6570\u7684\u4f7f\u7528"},"content":{"rendered":"\n<p>\u63a5\u7740\u4e0a\u4e00\u7bc7\uff0c\u54b1\u4eec\u6765\u8bf4\u8bf4\u51fd\u6570\u4e2d\u7684\u90a3\u4e9b\u53c2\u6570\u7684\u4f7f\u7528\u3002<\/p>\n\n\n\n<h2>\u4ec0\u4e48\u662f\u53c2\u6570<\/h2>\n\n\n\n<p>\u6240\u8c13\u53c2\u6570\uff0c\u5c31\u662f\u6211\u4eec\u5728\u5b9a\u4e49\u8fd9\u4e2a\u51fd\u6570\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u63a5\u6536\u4e00\u4e9b\u201c\u53d8\u91cf\u201d\u6765\u64cd\u4f5c\uff0c\u6bd4\u5982\u6211\u4eec\u5b9a\u4e00\u4e2a\u6c42\u548c\u7684\u51fd\u6570\uff1a<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D648\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"518\" height=\"38\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-05-42.png\" alt=\"\" class=\"wp-image-671\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-05-42.png 518w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-05-42-300x22.png 300w\" sizes=\"(max-width: 518px) 100vw, 518px\" \/><\/figure><\/div>\n\n\n\n<p>\u6253\u5370\u7ed3\u679c\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"509\" height=\"52\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-06-10.png\" alt=\"\" class=\"wp-image-672\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-06-10.png 509w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2019\/09\/Screenshot-from-2019-09-16-18-06-10-300x31.png 300w\" sizes=\"(max-width: 509px) 100vw, 509px\" \/><\/figure><\/div>\n\n\n\n<h2>\u89e3\u5305<\/h2>\n\n\n\n<p>\u5f53\u4f60\u8c03\u7528\u51fd\u6570\u7684\u65f6\u5019\uff0c\u53c2\u6570\u5728\u5217\u8868\u6216\u5143\u7ec4\u6216\u5b57\u5178\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 * \u6216 ** \u6765\u89e3\u5305\u4f20\u9012\u53c2\u6570\u3002\u770b\u5217\u5b50\u5c31\u660e\u767d\u4e86\uff0c\u8fd8\u662f\u8fd9\u6837\u7684\u51fd\u6570\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&gt;&gt;&gt; def add(a, b):\n...     print(a+b)\n... \n<\/pre><\/div>\n\n\n\n<p>\u8fd9\u65f6\u5019\u6709\u8fd9\u6837\u7684\u5217\u8868\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&gt;&gt;&gt; l = [1, 2]<\/pre><\/div>\n\n\n\n<p>\u6211\u4eec\u60f3\u5c06\u5217\u8868 l \u4e2d\u7684 1\uff0c2 \u5f53\u4f5c\u53c2\u6570\u4f20\u9012\u7ed9 add\uff0c\u90a3\u5c31\u53ef\u4ee5\u8fd9\u6837\u5728\u524d\u9762\u52a0\u4e2a * \u8fdb\u884c\u89e3\u5305\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&gt;&gt;&gt; add(*l)\n3<\/pre><\/div>\n\n\n\n<p>\u5982\u679c\u662f\u5b57\u5178\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">d = {'a':1, 'b':2}<\/pre><\/div>\n\n\n\n<p>\u7528\u4e24\u4e2a * \u53f7\u89e3\u5305\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&gt;&gt;&gt; add(**d)\n3<\/pre><\/div>\n\n\n\n<h2>\u6ce8\u89e3<\/h2>\n\n\n\n<p>\u6700\u540e\u54b1\u4eec\u518d\u6765\u4e86\u89e3\u4e00\u4e0b\u51fd\u6570\u7684\u6ce8\u89e3\uff0c\u6211\u4eec\u77e5\u9053\uff0cPython \u5bf9\u4e8e\u7c7b\u578b\u662f\u4e0d\u533a\u5206\u7684\uff0c\u4f46\u662f\u4f60\u60f3\u8981\u5b9a\u4e49\u53c2\u6570\u7c7b\u578b\uff0c\u4e5f\u662f\u53ef\u4ee5\u7684\uff0c\u50cf\u8fd9\u6837\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&gt;&gt;&gt; def add(a: int, b: int) -&gt; int:\n...     print(a+b)<\/pre><\/div>\n\n\n\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f60\u53ef\u4ee5\u5728\u53c2\u6570\u540d\u79f0\u540e\u9762\u52a0\u4e2a\u5192\u53f7\uff0c\u7136\u540e\u58f0\u660e\u5176\u7c7b\u578b\uff0c\u800c\u7bad\u5934 -> \uff0c\u58f0\u660e\u7684\u662f\u8fd9\u4e2a\u51fd\u6570\u8fd4\u56de\u7684\u7c7b\u578b\u3002<\/p>\n\n\n\n<p>ok\uff0c\u4ee5\u4e0a\u5c31\u662f\u4f60\u9700\u8981\u4e86\u89e3\u7684\uff0c\u5728 Python \u51fd\u6570\u4e2d\u5bf9\u53c2\u6570\u7684\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a5\u7740\u4e0a\u4e00\u7bc7\uff0c\u54b1\u4eec\u6765\u8bf4\u8bf4\u51fd\u6570\u4e2d\u7684\u90a3\u4e9b\u53c2\u6570\u7684\u4f7f\u7528\u3002 \u4ec0\u4e48\u662f\u53c2\u6570 \u6240\u8c13\u53c2\u6570\uff0c\u5c31\u662f\u6211\u4eec\u5728\u5b9a\u4e49\u8fd9\u4e2a\u51fd\u6570\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u63a5\u6536\u4e00\u4e9b\u201c\u53d8\u91cf\u201d\u6765\u64cd\u4f5c\uff0c\u6bd4\u5982\u6211\u4eec\u5b9a\u4e00\u4e2a\u6c42\u548c\u7684\u51fd\u6570\uff1a \u6253\u5370\u7ed3\u679c\uff1a \u89e3\u5305 \u5f53\u4f60\u8c03\u7528\u51fd\u6570\u7684\u65f6\u5019\uff0c\u53c2\u6570\u5728\u5217\u8868\u6216\u5143\u7ec4\u6216\u5b57\u5178\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 * \u6216 ** \u6765\u89e3&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[19,20,38,62,69,70,56],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/648"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=648"}],"version-history":[{"count":5,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/648\/revisions"}],"predecessor-version":[{"id":6621,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/648\/revisions\/6621"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}