{"id":57753,"date":"2025-08-15T18:59:57","date_gmt":"2025-08-15T10:59:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/57753.html"},"modified":"2025-08-15T18:59:57","modified_gmt":"2025-08-15T10:59:57","slug":"%e3%80%90python%e3%80%91python-%e5%87%bd%e6%95%b0%e5%9f%ba%e6%9c%ac%e4%bb%8b%e7%bb%8d%ef%bc%88%e8%af%a6%e7%bb%86%e7%89%88%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/57753.html","title":{"rendered":"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b"},"content":{"rendered":"<h2>Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd&#xff08;\u8be6\u7ec6\u7248&#xff09;\u200b<\/h2>\n<hr \/>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd&#xff08;\u8be6\u7ec6\u7248&#xff09;\u200b<\/li>\n<li>\u524d\u8a00<\/li>\n<li>\u4e00\u3001\u51fd\u6570\u7684\u521b\u5efa\u200b<\/li>\n<li>\n<ul>\n<li>1.1 \u51fd\u6570\u540d\u7684\u547d\u540d\u89c4\u5219\u200b<\/li>\n<li>1.2 \u51fd\u6570\u7684\u521b\u5efa\u200b<\/li>\n<li>1.3 \u51fd\u6570\u7684\u8c03\u7528\u200b<\/li>\n<\/ul>\n<\/li>\n<li>\u4e8c\u3001\u51fd\u6570\u7684\u53c2\u6570\u200b<\/li>\n<li>\n<ul>\n<li>2.1 \u5f62\u53c2\u548c\u5b9e\u53c2\u200b<\/li>\n<li>2.2 \u4f4d\u7f6e\u53c2\u6570\u200b<\/li>\n<li>2.3 \u5173\u952e\u5b57\u53c2\u6570\u200b<\/li>\n<li>2.4 \u9ed8\u8ba4\u53c2\u6570\u200b<\/li>\n<li>2.5 \u4e0d\u5b9a\u957f\u53c2\u6570\u200b<\/li>\n<li>2.6 \u53c2\u6570\u7ec4\u5408\u4f7f\u7528\u200b<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u51fd\u6570\u7684\u8fd4\u56de\u503c\u200b<\/li>\n<li>\u56db\u3001\u533f\u540d\u51fd\u6570\u200b<\/li>\n<li>\u4e94\u3001\u51fd\u6570\u7684\u4f5c\u7528\u57df\u200b<\/li>\n<li>\u516d\u3001\u5d4c\u5957\u51fd\u6570\u200b<\/li>\n<li>\u4e03\u3001\u95ed\u5305\u200b<\/li>\n<li>\u516b\u3001\u9012\u5f52\u51fd\u6570\u200b<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ul>\n<hr \/>\n<h2>\u524d\u8a00<\/h2>\n<p>\u51fd\u6570\u662f Python \u7f16\u7a0b\u7684\u6838\u5fc3\u6784\u5efa\u5757&#xff0c;\u5b83\u5c06\u7279\u5b9a\u529f\u80fd\u7684\u4ee3\u7801\u5c01\u88c5\u6210\u72ec\u7acb\u5355\u5143&#xff0c;\u4e0d\u4ec5\u80fd\u51cf\u5c11\u91cd\u590d\u4ee3\u7801&#xff0c;\u8fd8\u80fd\u8ba9\u7a0b\u5e8f\u7ed3\u6784\u66f4\u6e05\u6670\u3001\u6613\u4e8e\u7ef4\u62a4\u3002\u6df1\u5165\u7406\u89e3\u51fd\u6570\u7684\u5404\u9879\u7279\u6027&#xff0c;\u662f\u7f16\u5199\u9ad8\u8d28\u91cf Python \u4ee3\u7801\u7684\u57fa\u7840\u3002\u200b<\/p>\n<hr \/>\n<h2>\u4e00\u3001\u51fd\u6570\u7684\u521b\u5efa\u200b<\/h2>\n<p>\u51fd\u6570\u521b\u5efa\u7684\u6838\u5fc3\u662f\u7528def\u5173\u952e\u5b57\u5b9a\u4e49\u4e00\u4e2a\u53ef\u590d\u7528\u7684\u4ee3\u7801\u5757&#xff0c;\u5176\u5b8c\u6574\u7ed3\u6784\u5305\u542b\u51fd\u6570\u540d\u3001\u53c2\u6570\u5217\u8868\u3001\u6587\u6863\u5b57\u7b26\u4e32\u3001\u51fd\u6570\u4f53\u548c\u8fd4\u56de\u503c&#xff0c;\u6bcf\u4e2a\u90e8\u5206\u90fd\u6709\u660e\u786e\u7684\u4f5c\u7528\u3002\u200b<\/p>\n<h3>1.1 \u51fd\u6570\u540d\u7684\u547d\u540d\u89c4\u5219\u200b<\/h3>\n<p>\u51fd\u6570\u540d\u9700\u9075\u5faa Python \u6807\u8bc6\u7b26\u547d\u540d\u89c4\u8303&#xff1a;\u200b<\/p>\n<ul>\n<li>\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf\u200b<\/li>\n<li>\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934\u200b<\/li>\n<li>\u4e0d\u80fd\u4f7f\u7528 Python \u5173\u952e\u5b57&#xff08;\u5982def\u3001if\u7b49&#xff09;\u200b<\/li>\n<li>\u5efa\u8bae\u4f7f\u7528\u5c0f\u5199\u5b57\u6bcd&#xff0c;\u591a\u4e2a\u5355\u8bcd\u7528\u4e0b\u5212\u7ebf\u8fde\u63a5&#xff08;\u86c7\u5f62\u547d\u540d\u6cd5&#xff09;&#xff0c;\u5982calculate_average<\/li>\n<\/ul>\n<h3>1.2 \u51fd\u6570\u7684\u521b\u5efa\u200b<\/h3>\n<p>\u521b\u5efa\u51fd\u6570\u4f7f\u7528def\u5173\u952e\u5b57&#xff0c;\u57fa\u672c\u8bed\u6cd5\u4e3a&#xff1a;\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> \u51fd\u6570\u540d<span class=\"token punctuation\">(<\/span>\u53c2\u6570<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    \u51fd\u6570\u4f53<br \/>\n    <span class=\"token keyword\">return<\/span> \u8fd4\u56de\u503c<\/p>\n<p>\u4f8b\u5982&#xff0c;\u521b\u5efa\u4e00\u4e2a\u8ba1\u7b97\u4e24\u6570\u4e4b\u548c\u7684\u51fd\u6570&#xff1a;\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">add<\/span><span class=\"token punctuation\">(<\/span>a<span class=\"token punctuation\">,<\/span> b<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    result <span class=\"token operator\">&#061;<\/span> a <span class=\"token operator\">&#043;<\/span> b\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> result<\/p>\n<p>\u8fd9\u91cc\u7684add\u662f\u51fd\u6570\u540d&#xff0c;a\u548cb\u662f\u53c2\u6570&#xff0c;\u51fd\u6570\u4f53\u662f\u8ba1\u7b97\u4e24\u6570\u4e4b\u548c\u5e76\u5c06\u7ed3\u679c\u8d4b\u7ed9result&#xff0c;\u6700\u540e\u901a\u8fc7return\u8fd4\u56deresult\u3002\u200b<\/p>\n<h3>1.3 \u51fd\u6570\u7684\u8c03\u7528\u200b<\/h3>\n<p>\u8c03\u7528\u51fd\u6570\u53ea\u9700\u4f7f\u7528 \u201c\u51fd\u6570\u540d (\u53c2\u6570)\u201d \u7684\u5f62\u5f0f\u3002\u4ee5\u4e0a\u9762\u7684add\u51fd\u6570\u4e3a\u4f8b&#xff1a;\u200b<\/p>\n<p>sum_result <span class=\"token operator\">&#061;<\/span> add<span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sum_result<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;8\u200b<\/span><\/p>\n<p>\u5f53\u8c03\u7528add(3, 5)\u65f6&#xff0c;\u51fd\u6570\u5185\u90e8\u7684a\u88ab\u8d4b\u503c\u4e3a 3&#xff0c;b\u88ab\u8d4b\u503c\u4e3a 5&#xff0c;\u7ecf\u8fc7\u8ba1\u7b97\u540e\u8fd4\u56de 8&#xff0c;\u7136\u540e\u5c06 8 \u8d4b\u7ed9sum_result\u5e76\u6253\u5370\u51fa\u6765\u3002\u200b<\/p>\n<hr \/>\n<h2>\u4e8c\u3001\u51fd\u6570\u7684\u53c2\u6570\u200b<\/h2>\n<p>\u51fd\u6570\u7684\u53c2\u6570\u662f\u51fd\u6570\u4e0e\u5916\u90e8\u4ea4\u4e92\u7684\u6865\u6881&#xff0c;\u6839\u636e\u4f20\u9012\u548c\u5b9a\u4e49\u65b9\u5f0f\u7684\u4e0d\u540c&#xff0c;\u53ef\u5206\u4e3a\u591a\u79cd\u7c7b\u578b\u3002\u5176\u4e2d&#xff0c;\u5f62\u53c2\u548c\u5b9e\u53c2\u662f\u53c2\u6570\u7684\u57fa\u672c\u6982\u5ff5\u3002\u200b<\/p>\n<h3>2.1 \u5f62\u53c2\u548c\u5b9e\u53c2\u200b<\/h3>\n<p>\u5f62\u53c2&#xff08;\u5f62\u5f0f\u53c2\u6570&#xff09;&#xff1a;\u5728\u5b9a\u4e49\u51fd\u6570\u65f6&#xff0c;\u62ec\u53f7\u4e2d\u5217\u51fa\u7684\u53c2\u6570\u79f0\u4e3a\u5f62\u53c2&#xff0c;\u5b83\u4eec\u53ea\u662f\u51fd\u6570\u5b9a\u4e49\u65f6\u7528\u6765\u63a5\u6536\u5916\u90e8\u4f20\u5165\u6570\u636e\u7684 \u201c\u5360\u4f4d\u7b26\u201d&#xff0c;\u6ca1\u6709\u5177\u4f53\u7684\u503c\u3002<\/p>\n<p>\u4f8b\u5982\u5728def add(a, b):\u4e2d&#xff0c;a\u548cb\u5c31\u662f\u5f62\u53c2\u3002\u200b<\/p>\n<p>\u5b9e\u53c2&#xff08;\u5b9e\u9645\u53c2\u6570&#xff09;&#xff1a;\u5728\u8c03\u7528\u51fd\u6570\u65f6&#xff0c;\u62ec\u53f7\u4e2d\u4f20\u5165\u7684\u5177\u4f53\u6570\u636e\u79f0\u4e3a\u5b9e\u53c2&#xff0c;\u5b83\u4eec\u4f1a\u88ab\u8d4b\u503c\u7ed9\u5bf9\u5e94\u7684\u5f62\u53c2\u3002<\/p>\n<p>\u4f8b\u5982\u5728add(3, 5)\u4e2d&#xff0c;3\u548c5\u5c31\u662f\u5b9e\u53c2&#xff0c;\u5206\u522b\u8d4b\u503c\u7ed9\u5f62\u53c2a\u548cb\u3002\u200b<\/p>\n<p>\u5f62\u53c2\u548c\u5b9e\u53c2\u7684\u5173\u7cfb\u662f&#xff1a;\u5b9e\u53c2\u662f\u5f62\u53c2\u7684\u5177\u4f53\u503c&#xff0c;\u5728\u51fd\u6570\u8c03\u7528\u65f6&#xff0c;\u5b9e\u53c2\u7684\u503c\u4f1a\u4f20\u9012\u7ed9\u5f62\u53c2&#xff0c;\u4f9b\u51fd\u6570\u4f53\u4f7f\u7528\u3002\u200b<\/p>\n<h3>2.2 \u4f4d\u7f6e\u53c2\u6570\u200b<\/h3>\n<p>\u4f4d\u7f6e\u53c2\u6570\u662f\u6700\u5e38\u89c1\u7684\u53c2\u6570\u7c7b\u578b&#xff0c;\u53c2\u6570\u6309\u7167\u4f4d\u7f6e\u987a\u5e8f\u4f20\u9012&#xff0c;\u5b9e\u53c2\u4e0e\u5f62\u53c2\u5fc5\u987b\u4e00\u4e00\u5bf9\u5e94&#xff0c;\u6570\u91cf\u4e5f\u5fc5\u987b\u4e00\u81f4\u3002\u5982add(3,5)\u4e2d&#xff0c;3 \u4f20\u7ed9a&#xff0c;5 \u4f20\u7ed9b\u3002\u5982\u679c\u53c2\u6570\u6570\u91cf\u4e0d\u5339\u914d&#xff0c;\u4f1a\u62a5\u9519&#xff0c;\u4f8b\u5982add(3)\u4f1a\u63d0\u793a\u7f3a\u5c11\u4e00\u4e2a\u4f4d\u7f6e\u53c2\u6570\u3002\u200b<\/p>\n<h3>2.3 \u5173\u952e\u5b57\u53c2\u6570\u200b<\/h3>\n<p>\u8c03\u7528\u65f6\u6307\u5b9a\u53c2\u6570\u540d&#xff08;\u5f62\u53c2\u540d&#xff09;&#xff0c;\u53ef\u6539\u53d8\u53c2\u6570\u987a\u5e8f&#xff0c;\u4f7f\u4ee3\u7801\u66f4\u5177\u53ef\u8bfb\u6027\u3002\u4f8b\u5982&#xff1a;\u200b<\/p>\n<p>sum_result <span class=\"token operator\">&#061;<\/span> add<span class=\"token punctuation\">(<\/span>b<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">,<\/span> a<span class=\"token operator\">&#061;<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sum_result<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;8\u200b<\/span><\/p>\n<p>\u8fd9\u91cc\u660e\u786e\u6307\u5b9ab\u4e3a 5&#xff0c;a\u4e3a 3&#xff0c;\u867d\u7136\u987a\u5e8f\u4e0e\u51fd\u6570\u5b9a\u4e49\u65f6\u4e0d\u540c&#xff0c;\u4f46\u4ecd\u80fd\u6b63\u786e\u8ba1\u7b97\u7ed3\u679c\u3002\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u65f6&#xff0c;\u5173\u952e\u5b57\u5fc5\u987b\u662f\u51fd\u6570\u5b9a\u4e49\u65f6\u7684\u5f62\u53c2\u540d&#xff0c;\u5426\u5219\u4f1a\u62a5\u9519\u3002\u200b<\/p>\n<h3>2.4 \u9ed8\u8ba4\u53c2\u6570\u200b<\/h3>\n<p>\u5b9a\u4e49\u51fd\u6570\u65f6\u7ed9\u5f62\u53c2\u8bbe\u7f6e\u9ed8\u8ba4\u503c&#xff0c;\u8c03\u7528\u65f6\u53ef\u7701\u7565\u8be5\u53c2\u6570&#xff0c;\u82e5\u4e0d\u7701\u7565\u5219\u4f7f\u7528\u4f20\u9012\u7684\u5b9e\u53c2\u503c\u3002\u793a\u4f8b&#xff1a;\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">greet<\/span><span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">,<\/span> greeting<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Hello&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>greeting<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">, <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>name<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">!&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\ngreet<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Alice&#034;<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;Hello, Alice!\u200b<\/span><br \/>\ngreet<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Bob&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;Hi&#034;<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;Hi, Bob!\u200b<\/span><\/p>\n<p>\u5728greet\u51fd\u6570\u4e2d&#xff0c;greeting\u662f\u8bbe\u7f6e\u4e86\u9ed8\u8ba4\u503c \u201cHello\u201d \u7684\u5f62\u53c2&#xff0c;\u5f53\u8c03\u7528greet(\u201cAlice\u201d)\u65f6&#xff0c;\u6ca1\u6709\u4f20\u9012\u5bf9\u5e94greeting\u7684\u5b9e\u53c2&#xff0c;\u5c31\u4f7f\u7528\u9ed8\u8ba4\u503c&#xff1b;\u8c03\u7528greet(\u201cBob\u201d, \u201cHi\u201d)\u65f6&#xff0c;\u4f20\u9012\u4e86\u5b9e\u53c2 \u201cHi\u201d&#xff0c;\u5219\u4f7f\u7528\u8be5\u503c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u9ed8\u8ba4\u53c2\u6570\u5fc5\u987b\u653e\u5728\u4f4d\u7f6e\u53c2\u6570\u4e4b\u540e&#xff0c;\u5426\u5219\u4f1a\u62a5\u9519&#xff0c;\u4f8b\u5982def greet(greeting&#061;\u201cHello\u201d, name):\u662f\u9519\u8bef\u7684\u3002\u200b<\/p>\n<h3>2.5 \u4e0d\u5b9a\u957f\u53c2\u6570\u200b<\/h3>\n<p>\u5f53\u4e0d\u786e\u5b9a\u9700\u8981\u4f20\u9012\u591a\u5c11\u4e2a\u5b9e\u53c2\u65f6&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0d\u5b9a\u957f\u53c2\u6570&#xff0c;\u5b83\u4eec\u80fd\u63a5\u6536\u4efb\u610f\u6570\u91cf\u7684\u5b9e\u53c2\u3002\u200b *args&#xff1a;\u63a5\u6536\u4efb\u610f\u6570\u91cf\u7684\u4f4d\u7f6e\u5b9e\u53c2&#xff0c;\u4ee5\u5143\u7ec4\u5f62\u5f0f\u5b58\u50a8&#xff0c;args\u662f\u7ea6\u5b9a\u4fd7\u6210\u7684\u540d\u79f0&#xff0c;\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u540d\u79f0&#xff0c;\u4f46\u5efa\u8bae\u4f7f\u7528args\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">sum_numbers<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    total <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span>\u200b<br \/>\n    <span class=\"token keyword\">for<\/span> num <span class=\"token keyword\">in<\/span> args<span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        total <span class=\"token operator\">&#043;&#061;<\/span> num\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> total\u200b<br \/>\n\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sum_numbers<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;6\u200b<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sum_numbers<span class=\"token punctuation\">(<\/span><span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">7<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;22\u200b<\/span><br \/>\n\u200b<\/p>\n<p>\u5728sum_numbers\u51fd\u6570\u4e2d&#xff0c;*args\u63a5\u6536\u4e86\u4f20\u9012\u7684\u6240\u6709\u4f4d\u7f6e\u5b9e\u53c2&#xff0c;\u7136\u540e\u901a\u8fc7\u5faa\u73af\u5c06\u5b83\u4eec\u76f8\u52a0\u3002\u200b **kwargs&#xff1a;\u63a5\u6536\u4efb\u610f\u6570\u91cf\u7684\u5173\u952e\u5b57\u5b9e\u53c2&#xff0c;\u4ee5\u5b57\u5178\u5f62\u5f0f\u5b58\u50a8&#xff0c;\u5176\u4e2d\u952e\u662f\u53c2\u6570\u540d&#xff08;\u5f62\u53c2\u540d&#xff09;&#xff0c;\u503c\u662f\u53c2\u6570\u503c&#xff08;\u5b9e\u53c2\u503c&#xff09;&#xff0c;kwargs\u662f\u7ea6\u5b9a\u4fd7\u6210\u7684\u540d\u79f0&#xff0c;\u4e5f\u53ef\u4f7f\u7528\u5176\u4ed6\u540d\u79f0&#xff0c;\u5efa\u8bae\u4f7f\u7528kwargs\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">print_info<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">**<\/span> kwargs<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">for<\/span> key<span class=\"token punctuation\">,<\/span> value <span class=\"token keyword\">in<\/span> kwargs<span class=\"token punctuation\">.<\/span>items<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>key<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>value<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\nprint_info<span class=\"token punctuation\">(<\/span>name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Alice&#034;<\/span><span class=\"token punctuation\">,<\/span> age<span class=\"token operator\">&#061;<\/span><span class=\"token number\">20<\/span><span class=\"token punctuation\">,<\/span> gender<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;female&#034;<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token comment\"># \u8f93\u51fa&#xff1a;\u200b<\/span><br \/>\n<span class=\"token comment\"># name: Alice\u200b<\/span><br \/>\n<span class=\"token comment\"># age: 20\u200b<\/span><br \/>\n<span class=\"token comment\"># gender: female\u200b<\/span><\/p>\n<p>\u8fd9\u91cc**kwargs\u63a5\u6536\u4e86name\u3001age\u3001gender\u4e09\u4e2a\u5173\u952e\u5b57\u5b9e\u53c2&#xff0c;\u5e76\u4ee5\u5b57\u5178\u7684\u5f62\u5f0f\u904d\u5386\u8f93\u51fa\u3002\u200b<\/p>\n<h3>2.6 \u53c2\u6570\u7ec4\u5408\u4f7f\u7528\u200b<\/h3>\n<p>\u5728\u5b9a\u4e49\u51fd\u6570\u65f6&#xff0c;\u591a\u79cd\u53c2\u6570\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528&#xff0c;\u4f46\u9700\u8981\u9075\u5faa\u4e00\u5b9a\u7684\u987a\u5e8f&#xff1a;\u4f4d\u7f6e\u53c2\u6570\u5728\u524d&#xff0c;\u7136\u540e\u662f\u9ed8\u8ba4\u53c2\u6570&#xff0c;\u63a5\u7740\u662f*args&#xff0c;\u6700\u540e\u662f**kwargs\u3002\u4f8b\u5982&#xff1a;\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">func<\/span><span class=\"token punctuation\">(<\/span>a<span class=\"token punctuation\">,<\/span> b<span class=\"token punctuation\">,<\/span> c<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token operator\">*<\/span>args<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">**<\/span>kwargs<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;a&#061;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>a<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">, b&#061;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>b<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">, c&#061;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>c<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;args:&#034;<\/span><span class=\"token punctuation\">,<\/span> args<span class=\"token punctuation\">)<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;kwargs:&#034;<\/span><span class=\"token punctuation\">,<\/span> kwargs<span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\nfunc<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">,<\/span> name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;test&#034;<\/span><span class=\"token punctuation\">,<\/span> age<span class=\"token operator\">&#061;<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token comment\"># \u8f93\u51fa&#xff1a;\u200b<\/span><br \/>\n<span class=\"token comment\"># a&#061;1, b&#061;2, c&#061;3\u200b<\/span><br \/>\n<span class=\"token comment\"># args: (4, 5)\u200b<\/span><br \/>\n<span class=\"token comment\"># kwargs: {&#039;name&#039;: &#039;test&#039;, &#039;age&#039;: 10}\u200b<\/span><\/p>\n<hr \/>\n<h2>\u4e09\u3001\u51fd\u6570\u7684\u8fd4\u56de\u503c\u200b<\/h2>\n<p>\u51fd\u6570\u7684\u8fd4\u56de\u503c\u662f\u51fd\u6570\u6267\u884c\u5b8c\u6210\u540e\u7ed9\u51fa\u7684\u7ed3\u679c&#xff0c;\u901a\u8fc7return\u8bed\u53e5\u5b9e\u73b0\u3002\u200b \u7528return\u8fd4\u56de\u7ed3\u679c&#xff0c;\u51fd\u6570\u6267\u884c\u5230return\u540e\u505c\u6b62&#xff0c;\u540e\u7eed\u7684\u4ee3\u7801\u4e0d\u4f1a\u6267\u884c\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">check_number<\/span><span class=\"token punctuation\">(<\/span>num<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">if<\/span> num <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token string\">&#034;\u6b63\u6570&#034;<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8be5\u6570\u4e0d\u662f\u6b63\u6570&#034;<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>check_number<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;\u6b63\u6570\u200b<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>check_number<span class=\"token punctuation\">(<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;\u8be5\u6570\u4e0d\u662f\u6b63\u6570  \u7136\u540e\u8f93\u51faNone\u200b<\/span><\/p>\n<p>\u5f53num\u4e3a 5 \u65f6&#xff0c;\u51fd\u6570\u6267\u884c\u5230return &#034;\u6b63\u6570&#034;\u5c31\u505c\u6b62&#xff0c;\u4e0d\u4f1a\u6267\u884c\u540e\u9762\u7684\u6253\u5370\u8bed\u53e5&#xff1b;\u5f53num\u4e3a &#8211; 3 \u65f6&#xff0c;\u4e0d\u6ee1\u8db3if\u6761\u4ef6&#xff0c;\u4f1a\u6267\u884c\u6253\u5370\u8bed\u53e5&#xff0c;\u7136\u540e\u51fd\u6570\u9ed8\u8ba4\u8fd4\u56deNone\u3002\u200b<\/p>\n<p>\u53ef\u8fd4\u56de\u591a\u4e2a\u503c&#xff0c;\u4ee5\u5143\u7ec4\u5f62\u5f0f\u63a5\u6536&#xff0c;\u4e5f\u53ef\u5206\u522b\u63a5\u6536\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">get_name_and_age<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token string\">&#034;Alice&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">20<\/span>\u200b<br \/>\n\u200b<br \/>\n<span class=\"token comment\"># \u4ee5\u5143\u7ec4\u5f62\u5f0f\u63a5\u6536\u200b<\/span><br \/>\ninfo <span class=\"token operator\">&#061;<\/span> get_name_and_age<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>info<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;(&#039;Alice&#039;, 20)\u200b<\/span><br \/>\n\u200b<br \/>\n<span class=\"token comment\"># \u5206\u522b\u63a5\u6536\u200b<\/span><br \/>\nname<span class=\"token punctuation\">,<\/span> age <span class=\"token operator\">&#061;<\/span> get_name_and_age<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">,<\/span> age<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;Alice 20\u200b<\/span><\/p>\n<hr \/>\n<h2>\u56db\u3001\u533f\u540d\u51fd\u6570\u200b<\/h2>\n<p>\u7528lambda\u521b\u5efa&#xff0c;\u8bed\u6cd5&#xff1a;lambda \u53c2\u6570: \u8868\u8fbe\u5f0f&#xff0c;\u9002\u5408\u5b9e\u73b0\u7b80\u5355\u7684\u529f\u80fd&#xff0c;\u8fd4\u56de\u503c\u662f\u8868\u8fbe\u5f0f\u7684\u7ed3\u679c\u3002\u200b<\/p>\n<p>add <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">lambda<\/span> a<span class=\"token punctuation\">,<\/span> b<span class=\"token punctuation\">:<\/span> a <span class=\"token operator\">&#043;<\/span> b\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>add<span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;8\u200b<\/span><br \/>\n\u200b<br \/>\n<span class=\"token comment\"># \u7ed3\u5408\u5185\u7f6e\u51fd\u6570\u4f7f\u7528\u200b<\/span><br \/>\nnumbers <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span>\u200b<br \/>\n<span class=\"token comment\"># \u6309\u5143\u7ec4\u4e2d\u7b2c\u4e8c\u4e2a\u5143\u7d20\u6392\u5e8f\u200b<\/span><br \/>\nnumbers<span class=\"token punctuation\">.<\/span>sort<span class=\"token punctuation\">(<\/span>key<span class=\"token operator\">&#061;<\/span><span class=\"token keyword\">lambda<\/span> x<span class=\"token punctuation\">:<\/span> x<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>numbers<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;[(4, 1), (1, 3), (2, 5)]\u200b<\/span><br \/>\n\u200b<\/p>\n<p>\u533f\u540d\u51fd\u6570\u901a\u5e38\u4e0emap\u3001filter\u3001sorted\u7b49\u5185\u7f6e\u51fd\u6570\u914d\u5408\u4f7f\u7528&#xff0c;\u4f7f\u4ee3\u7801\u66f4\u7b80\u6d01\u3002\u200b<\/p>\n<hr \/>\n<h2>\u4e94\u3001\u51fd\u6570\u7684\u4f5c\u7528\u57df\u200b<\/h2>\n<p>\u51fd\u6570\u7684\u4f5c\u7528\u57df\u6307\u7684\u662f\u53d8\u91cf\u53ef\u88ab\u8bbf\u95ee\u7684\u8303\u56f4&#xff0c;\u5206\u4e3a\u5c40\u90e8\u4f5c\u7528\u57df\u548c\u5168\u5c40\u4f5c\u7528\u57df\u3002\u200b<\/p>\n<ul>\n<li>\u5c40\u90e8\u4f5c\u7528\u57df&#xff1a;\u5728\u51fd\u6570\u5185\u90e8\u5b9a\u4e49\u7684\u53d8\u91cf&#xff0c;\u53ea\u80fd\u5728\u51fd\u6570\u5185\u90e8\u8bbf\u95ee&#xff0c;\u79f0\u4e3a\u5c40\u90e8\u53d8\u91cf\u3002\u200b<\/li>\n<\/ul>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">func<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    local_var <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">10<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>local_var<span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\nfunc<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;10\u200b<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>local_var<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u62a5\u9519&#xff0c;local_var\u672a\u5b9a\u4e49\u200b<\/span><\/p>\n<p>local_var\u662f\u5728func\u51fd\u6570\u5185\u90e8\u5b9a\u4e49\u7684\u5c40\u90e8\u53d8\u91cf&#xff0c;\u5728\u51fd\u6570\u5916\u90e8\u65e0\u6cd5\u8bbf\u95ee\u3002\u200b<\/p>\n<ul>\n<li>\u5168\u5c40\u4f5c\u7528\u57df&#xff1a;\u5728\u51fd\u6570\u5916\u90e8\u5b9a\u4e49\u7684\u53d8\u91cf&#xff0c;\u53ef\u5728\u51fd\u6570\u5185\u90e8\u8bbf\u95ee&#xff08;\u4f46\u4fee\u6539\u9700\u8981\u7528global\u5173\u952e\u5b57\u58f0\u660e&#xff09;&#xff0c;\u79f0\u4e3a\u5168\u5c40\u53d8\u91cf\u3002\u200b<\/li>\n<\/ul>\n<p>global_var <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20<\/span>\u200b<br \/>\n\u200b<br \/>\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">func1<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>global_var<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8bbf\u95ee\u5168\u5c40\u53d8\u91cf\u200b<\/span><br \/>\n\u200b<br \/>\n<span class=\"token keyword\">def<\/span> <span class=\"token function\">func2<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">global<\/span> global_var  <span class=\"token comment\"># \u58f0\u660e\u4fee\u6539\u5168\u5c40\u53d8\u91cf\u200b<\/span><br \/>\n    global_var <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">30<\/span>\u200b<br \/>\n\u200b<br \/>\nfunc1<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;20\u200b<\/span><br \/>\nfunc2<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>global_var<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;30\u200b<\/span><\/p>\n<p>global_var\u662f\u5168\u5c40\u53d8\u91cf&#xff0c;func1\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee&#xff1b;func2\u51fd\u6570\u8981\u4fee\u6539\u5168\u5c40\u53d8\u91cf&#xff0c;\u9700\u8981\u7528global\u5173\u952e\u5b57\u58f0\u660e&#xff0c;\u5426\u5219\u4f1a\u88ab\u8ba4\u4e3a\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5c40\u90e8\u53d8\u91cf\u3002\u200b<\/p>\n<ul>\n<li>\u975e\u5c40\u90e8\u4f5c\u7528\u57df&#xff1a;\u5728\u5d4c\u5957\u51fd\u6570\u4e2d&#xff0c;\u5185\u90e8\u51fd\u6570\u8bbf\u95ee\u5916\u90e8\u51fd\u6570\u7684\u53d8\u91cf&#xff08;\u975e\u5168\u5c40\u53d8\u91cf&#xff09;&#xff0c;\u79f0\u4e3a\u975e\u5c40\u90e8\u53d8\u91cf&#xff0c;\u82e5\u8981\u4fee\u6539\u9700\u7528nonlocal\u5173\u952e\u5b57\u58f0\u660e\u3002\u200b<\/li>\n<\/ul>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">outer_func<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    outer_var <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">100<\/span>\u200b<br \/>\n    <span class=\"token keyword\">def<\/span> <span class=\"token function\">inner_func<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        <span class=\"token keyword\">nonlocal<\/span> outer_var  <span class=\"token comment\"># \u58f0\u660e\u4fee\u6539\u975e\u5c40\u90e8\u53d8\u91cf\u200b<\/span><br \/>\n        outer_var <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">200<\/span>\u200b<br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;inner:&#034;<\/span><span class=\"token punctuation\">,<\/span> outer_var<span class=\"token punctuation\">)<\/span>\u200b<br \/>\n    inner_func<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;outer:&#034;<\/span><span class=\"token punctuation\">,<\/span> outer_var<span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\nouter_func<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token comment\"># \u8f93\u51fa&#xff1a;\u200b<\/span><br \/>\n<span class=\"token comment\"># inner: 200\u200b<\/span><br \/>\n<span class=\"token comment\"># outer: 200\u200b<\/span><\/p>\n<p>outer_var\u662f\u5916\u90e8\u51fd\u6570outer_func\u5b9a\u4e49\u7684\u53d8\u91cf&#xff0c;\u5185\u90e8\u51fd\u6570inner_func\u8981\u4fee\u6539\u5b83&#xff0c;\u9700\u7528nonlocal\u5173\u952e\u5b57\u58f0\u660e&#xff0c;\u4fee\u6539\u540e\u5916\u90e8\u51fd\u6570\u4e2d\u8be5\u53d8\u91cf\u7684\u503c\u4e5f\u4f1a\u6539\u53d8\u3002<\/p>\n<hr \/>\n<h2>\u516d\u3001\u5d4c\u5957\u51fd\u6570\u200b<\/h2>\n<p>\u5728\u4e00\u4e2a\u51fd\u6570\u5185\u90e8\u5b9a\u4e49\u53e6\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5185\u90e8\u7684\u51fd\u6570\u79f0\u4e3a\u5d4c\u5957\u51fd\u6570\u3002\u5d4c\u5957\u51fd\u6570\u53ef\u4ee5\u8bbf\u95ee\u5916\u90e8\u51fd\u6570\u7684\u53d8\u91cf&#xff08;\u82e5\u8981\u4fee\u6539\u9700\u7528nonlocal\u5173\u952e\u5b57&#xff09;\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">outer_func<\/span><span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">def<\/span> <span class=\"token function\">inner_func<\/span><span class=\"token punctuation\">(<\/span>y<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        <span class=\"token keyword\">return<\/span> x <span class=\"token operator\">&#043;<\/span> y\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> inner_func\u200b<br \/>\n\u200b<br \/>\nadd5 <span class=\"token operator\">&#061;<\/span> outer_func<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>add5<span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;8\u200b<\/span><\/p>\n<p>inner_func\u662fouter_func\u7684\u5d4c\u5957\u51fd\u6570&#xff0c;\u5b83\u53ef\u4ee5\u8bbf\u95eeouter_func\u7684\u53c2\u6570x\u3002outer_func(5)\u8fd4\u56deinner_func\u51fd\u6570&#xff0c;\u7136\u540eadd5(3)\u8c03\u7528\u8be5\u51fd\u6570&#xff0c;\u8ba1\u7b97 5&#043;3 \u7684\u7ed3\u679c\u3002\u200b<\/p>\n<hr \/>\n<h2>\u4e03\u3001\u95ed\u5305\u200b<\/h2>\n<p>\u95ed\u5305\u662f\u6307\u5d4c\u5957\u51fd\u6570\u4e2d&#xff0c;\u5185\u90e8\u51fd\u6570\u5f15\u7528\u4e86\u5916\u90e8\u51fd\u6570\u7684\u53d8\u91cf&#xff0c;\u5e76\u4e14\u5916\u90e8\u51fd\u6570\u8fd4\u56de\u4e86\u5185\u90e8\u51fd\u6570\u3002\u95ed\u5305\u53ef\u4ee5\u4fdd\u7559\u5916\u90e8\u51fd\u6570\u7684\u53d8\u91cf\u72b6\u6001\u3002\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">make_multiplier<\/span><span class=\"token punctuation\">(<\/span>factor<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">def<\/span> <span class=\"token function\">multiplier<\/span><span class=\"token punctuation\">(<\/span>number<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n        <span class=\"token keyword\">return<\/span> number <span class=\"token operator\">*<\/span> factor\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> multiplier\u200b<br \/>\n\u200b<br \/>\ntimes3 <span class=\"token operator\">&#061;<\/span> make_multiplier<span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\ntimes5 <span class=\"token operator\">&#061;<\/span> make_multiplier<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>times3<span class=\"token punctuation\">(<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;30\u200b<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>times5<span class=\"token punctuation\">(<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;50\u200b<\/span><\/p>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d&#xff0c;multiplier\u662f\u5185\u90e8\u51fd\u6570&#xff0c;\u5b83\u5f15\u7528\u4e86\u5916\u90e8\u51fd\u6570make_multiplier\u7684\u53d8\u91cffactor&#xff0c;\u5e76\u4e14make_multiplier\u8fd4\u56de\u4e86multiplier&#xff0c;\u6240\u4ee5\u5f62\u6210\u4e86\u95ed\u5305\u3002times3\u548ctimes5\u5206\u522b\u4fdd\u7559\u4e86factor\u4e3a 3 \u548c 5 \u7684\u72b6\u6001&#xff0c;\u56e0\u6b64\u8c03\u7528\u65f6\u4f1a\u5f97\u5230\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u200b<\/p>\n<hr \/>\n<h2>\u516b\u3001\u9012\u5f52\u51fd\u6570\u200b<\/h2>\n<p>\u9012\u5f52\u51fd\u6570\u662f\u6307\u5728\u51fd\u6570\u5185\u90e8\u8c03\u7528\u81ea\u8eab\u7684\u51fd\u6570&#xff0c;\u5e38\u7528\u4e8e\u89e3\u51b3\u5177\u6709\u9012\u5f52\u6027\u8d28\u7684\u95ee\u9898&#xff0c;\u5373\u95ee\u9898\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e0e\u539f\u95ee\u9898\u76f8\u4f3c\u4f46\u89c4\u6a21\u66f4\u5c0f\u7684\u5b50\u95ee\u9898\u3002\u4f7f\u7528\u9012\u5f52\u51fd\u6570\u9700\u8981\u6ce8\u610f\u8bbe\u7f6e\u7ec8\u6b62\u6761\u4ef6&#xff0c;\u907f\u514d\u65e0\u9650\u9012\u5f52\u3002\u200b<\/p>\n<p>\u9012\u5f52\u51fd\u6570\u7684\u5e94\u7528\u573a\u666f\u200b<\/p>\n<ul>\n<li>\u6570\u5b66\u95ee\u9898&#xff1a;\u5982\u9636\u4e58\u8ba1\u7b97\u3001\u6590\u6ce2\u90a3\u5951\u6570\u5217\u3001\u6c49\u8bfa\u5854\u95ee\u9898\u7b49\u3002\u200b<\/li>\n<li>\u6570\u636e\u7ed3\u6784\u904d\u5386&#xff1a;\u5982\u6811\u7684\u6df1\u5ea6\u4f18\u5148\u904d\u5386\u3001\u94fe\u8868\u7684\u67d0\u4e9b\u64cd\u4f5c\u7b49\u3002\u200b<\/li>\n<li>\u7b97\u6cd5\u5b9e\u73b0&#xff1a;\u5982\u5feb\u901f\u6392\u5e8f\u3001\u5f52\u5e76\u6392\u5e8f\u7b49\u6392\u5e8f\u7b97\u6cd5\u7684\u9012\u5f52\u5b9e\u73b0\u3002\u200b<\/li>\n<\/ul>\n<p>\u5b9e\u4f8b\u200b&#xff1a;\u8ba1\u7b97\u9636\u4e58\u200b<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">factorial<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\u200b<br \/>\n    <span class=\"token keyword\">if<\/span> n <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">:<\/span>  <span class=\"token comment\"># \u7ec8\u6b62\u6761\u4ef6\u200b<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token number\">1<\/span>\u200b<br \/>\n    <span class=\"token keyword\">return<\/span> n <span class=\"token operator\">*<\/span> factorial<span class=\"token punctuation\">(<\/span>n <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\u200b<br \/>\n\u200b<br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>factorial<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u8f93\u51fa&#xff1a;120&#xff0c;5! &#061; 5*4*3*2*1 &#061; 120\u200b<\/span><\/p>\n<p>\u5f53n\u4e3a 1 \u65f6&#xff0c;\u51fd\u6570\u8fd4\u56de 1&#xff0c;\u5426\u5219\u8fd4\u56den\u4e58\u4ee5n-1\u7684\u9636\u4e58&#xff0c;\u901a\u8fc7\u4e0d\u65ad\u8c03\u7528\u81ea\u8eab\u6765\u8ba1\u7b97\u7ed3\u679c\u3002\u200b<\/p>\n<p>\u8ba1\u7b97\u6590\u6ce2\u90a3\u5951\u6570\u5217&#xff08;\u7b2c n \u9879&#xff09;\u200b<\/p>\n<p>def fibonacci(n):\u200b<br \/>\n    if n &lt;&#061; 1:  # \u7ec8\u6b62\u6761\u4ef6\u200b<br \/>\n        return n\u200b<br \/>\n    return fibonacci(n &#8211; 1) &#043; fibonacci(n &#8211; 2)\u200b<br \/>\n\u200b<br \/>\nprint(fibonacci(6))  # \u8f93\u51fa&#xff1a;8&#xff0c;\u6590\u6ce2\u90a3\u5951\u6570\u5217\u524d\u51e0\u9879&#xff1a;0,1,1,2,3,5,8&#8230;\u7b2c6\u9879\u662f8\u200b<\/p>\n<hr \/>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u51fd\u6570\u901a\u8fc7\u6a21\u5757\u5316\u8bbe\u8ba1\u964d\u4f4e\u4e86\u4ee3\u7801\u5197\u4f59&#xff0c;\u5176\u4e30\u5bcc\u7684\u53c2\u6570\u7c7b\u578b\u4e0e\u9ad8\u7ea7\u7279\u6027&#xff08;\u5982\u95ed\u5305\u3001\u9012\u5f52&#xff09;\u4f7f\u5176\u80fd\u9002\u5e94\u4ece\u7b80\u5355\u8ba1\u7b97\u5230\u590d\u6742\u903b\u8f91\u7684\u591a\u79cd\u573a\u666f\u3002\u638c\u63e1\u51fd\u6570\u7684\u547d\u540d\u89c4\u8303\u3001\u53c2\u6570\u4f20\u9012\u673a\u5236\u3001\u4f5c\u7528\u57df\u89c4\u5219\u53ca\u9ad8\u7ea7\u7279\u6027\u7684\u5e94\u7528&#xff0c;\u662f\u7f16\u5199\u9ad8\u6548\u3001\u53ef\u8bfb\u3001\u53ef\u7ef4\u62a4 Python \u4ee3\u7801\u7684\u57fa\u7840\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u9700\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u51fd\u6570\u5f62\u5f0f\u4e0e\u53c2\u6570\u7c7b\u578b&#xff0c;\u5145\u5206\u53d1\u6325\u51fd\u6570\u7684\u5c01\u88c5\u4e0e\u590d\u7528\u4ef7\u503c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf25\u6b21\u3002Python\u51fd\u6570\u662f\u4ee3\u7801\u5c01\u88c5\u7684\u6838\u5fc3\u6784\u5efa\u5757\uff0c\u5408\u7406\u4f7f\u7528\u51fd\u6570\u80fd\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,190],"topic":[],"class_list":["post-57753","post","type-post","status-publish","format-standard","hentry","category-server","tag-python","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/57753.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf25\u6b21\u3002Python\u51fd\u6570\u662f\u4ee3\u7801\u5c01\u88c5\u7684\u6838\u5fc3\u6784\u5efa\u5757\uff0c\u5408\u7406\u4f7f\u7528\u51fd\u6570\u80fd\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/57753.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T10:59:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57753.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/57753.html\",\"name\":\"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T10:59:57+00:00\",\"dateModified\":\"2025-08-15T10:59:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/57753.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/57753.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57753.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/57753.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf25\u6b21\u3002Python\u51fd\u6570\u662f\u4ee3\u7801\u5c01\u88c5\u7684\u6838\u5fc3\u6784\u5efa\u5757\uff0c\u5408\u7406\u4f7f\u7528\u51fd\u6570\u80fd\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/57753.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T10:59:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/57753.html","url":"https:\/\/www.wsisp.com\/helps\/57753.html","name":"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T10:59:57+00:00","dateModified":"2025-08-15T10:59:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/57753.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/57753.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/57753.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Python\u3011Python \u51fd\u6570\u57fa\u672c\u4ecb\u7ecd\uff08\u8be6\u7ec6\u7248\uff09\u200b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=57753"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57753\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=57753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=57753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=57753"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=57753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}