{"id":566,"date":"2025-10-23T15:05:39","date_gmt":"2025-10-23T07:05:39","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=566"},"modified":"2025-10-23T15:05:40","modified_gmt":"2025-10-23T07:05:40","slug":"python3-%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/10\/23\/python3-%e5%87%bd%e6%95%b0\/","title":{"rendered":"Python3 \u51fd\u6570"},"content":{"rendered":"\n<p>\u51fd\u6570\u662f\u7ec4\u7ec7\u597d\u7684\uff0c\u53ef\u91cd\u590d\u4f7f\u7528\u7684\uff0c\u7528\u6765\u5b9e\u73b0\u5355\u4e00\uff0c\u6216\u76f8\u5173\u8054\u529f\u80fd\u7684\u4ee3\u7801\u6bb5\u3002<\/p>\n\n\n\n<p>\u51fd\u6570\u80fd\u63d0\u9ad8\u5e94\u7528\u7684\u6a21\u5757\u6027\uff0c\u548c\u4ee3\u7801\u7684\u91cd\u590d\u5229\u7528\u7387\u3002\u4f60\u5df2\u7ecf\u77e5\u9053Python\u63d0\u4f9b\u4e86\u8bb8\u591a\u5185\u5efa\u51fd\u6570\uff0c\u6bd4\u5982print()\u3002\u4f46\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u521b\u5efa\u51fd\u6570\uff0c\u8fd9\u88ab\u53eb\u505a\u7528\u6237\u81ea\u5b9a\u4e49\u51fd\u6570\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570<\/h2>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u7531\u81ea\u5df1\u60f3\u8981\u529f\u80fd\u7684\u51fd\u6570\uff0c\u4ee5\u4e0b\u662f\u7b80\u5355\u7684\u89c4\u5219\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u51fd\u6570\u4ee3\u7801\u5757\u4ee5\u00a0<strong>def<\/strong>\u00a0\u5173\u952e\u8bcd\u5f00\u5934\uff0c\u540e\u63a5\u51fd\u6570\u6807\u8bc6\u7b26\u540d\u79f0\u548c\u5706\u62ec\u53f7\u00a0<strong>()<\/strong>\u3002<\/li>\n\n\n\n<li>\u4efb\u4f55\u4f20\u5165\u53c2\u6570\u548c\u81ea\u53d8\u91cf\u5fc5\u987b\u653e\u5728\u5706\u62ec\u53f7\u4e2d\u95f4\uff0c\u5706\u62ec\u53f7\u4e4b\u95f4\u53ef\u4ee5\u7528\u4e8e\u5b9a\u4e49\u53c2\u6570\u3002<\/li>\n\n\n\n<li>\u51fd\u6570\u7684\u7b2c\u4e00\u884c\u8bed\u53e5\u53ef\u4ee5\u9009\u62e9\u6027\u5730\u4f7f\u7528\u6587\u6863\u5b57\u7b26\u4e32\u2014\u7528\u4e8e\u5b58\u653e\u51fd\u6570\u8bf4\u660e\u3002<\/li>\n\n\n\n<li>\u51fd\u6570\u5185\u5bb9\u4ee5\u5192\u53f7\u00a0<strong>:<\/strong>\u00a0\u8d77\u59cb\uff0c\u5e76\u4e14\u7f29\u8fdb\u3002<\/li>\n\n\n\n<li><strong>return [\u8868\u8fbe\u5f0f]<\/strong>\u00a0\u7ed3\u675f\u51fd\u6570\uff0c\u9009\u62e9\u6027\u5730\u8fd4\u56de\u4e00\u4e2a\u503c\u7ed9\u8c03\u7528\u65b9\uff0c\u4e0d\u5e26\u8868\u8fbe\u5f0f\u7684 return \u76f8\u5f53\u4e8e\u8fd4\u56de None\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.runoob.com\/wp-content\/uploads\/2014\/05\/py-tup-10-26-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u8bed\u6cd5<\/h3>\n\n\n\n<p>Python \u5b9a\u4e49\u51fd\u6570\u4f7f\u7528 def \u5173\u952e\u5b57\uff0c\u4e00\u822c\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def \u51fd\u6570\u540d\uff08\u53c2\u6570\u5217\u8868\uff09:\n    \u51fd\u6570\u4f53<\/pre>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53c2\u6570\u503c\u548c\u53c2\u6570\u540d\u79f0\u662f\u6309\u51fd\u6570\u58f0\u660e\u4e2d\u5b9a\u4e49\u7684\u987a\u5e8f\u5339\u914d\u8d77\u6765\u7684\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u8ba9\u6211\u4eec\u4f7f\u7528\u51fd\u6570\u6765\u8f93\u51fa&#8221;Hello World\uff01&#8221;\uff1a<\/p>\n\n\n\n<p>#!\/usr\/bin\/python3<\/p>\n\n\n\n<p><strong>def<\/strong>&nbsp;hello()&nbsp;:<br>&nbsp;<strong>print<\/strong>(&#8220;Hello World!&#8221;)<\/p>\n\n\n\n<p>hello()<\/p>\n\n\n\n<p>\u66f4\u590d\u6742\u70b9\u7684\u5e94\u7528\uff0c\u51fd\u6570\u4e2d\u5e26\u4e0a\u53c2\u6570\u53d8\u91cf:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>\u6bd4\u8f83\u4e24\u4e2a\u6570\uff0c\u5e76\u8fd4\u56de\u8f83\u5927\u7684\u6570:<\/p>\n\n\n\n<p>#!\/usr\/bin\/python3 def max(a, b): if a &gt; b: return a else: return b a = 4 b = 5 print(max(a, b))<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">5<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>\u8ba1\u7b97\u9762\u79ef\u51fd\u6570:<\/p>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u8ba1\u7b97\u9762\u79ef\u51fd\u6570 def area(width, height): return width * height def print_welcome(name): print(&#8220;Welcome&#8221;, name) print_welcome(&#8220;Runoob&#8221;) w = 4 h = 5 print(&#8220;width =&#8221;, w, &#8221; height =&#8221;, h, &#8221; area =&#8221;, area(w, h))<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Welcome Runoob\nwidth = 4  height = 5  area = 20<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u51fd\u6570\u8c03\u7528<\/h2>\n\n\n\n<p>\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\uff1a\u7ed9\u4e86\u51fd\u6570\u4e00\u4e2a\u540d\u79f0\uff0c\u6307\u5b9a\u4e86\u51fd\u6570\u91cc\u5305\u542b\u7684\u53c2\u6570\uff0c\u548c\u4ee3\u7801\u5757\u7ed3\u6784\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u51fd\u6570\u7684\u57fa\u672c\u7ed3\u6784\u5b8c\u6210\u4ee5\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u53e6\u4e00\u4e2a\u51fd\u6570\u8c03\u7528\u6267\u884c\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4ece Python \u547d\u4ee4\u63d0\u793a\u7b26\u6267\u884c\u3002<\/p>\n\n\n\n<p>\u5982\u4e0b\u5b9e\u4f8b\u8c03\u7528\u4e86&nbsp;<strong>printme()<\/strong>&nbsp;\u51fd\u6570\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u5b9a\u4e49\u51fd\u6570 def printme( str ): # \u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u5b57\u7b26\u4e32 print (str) return # \u8c03\u7528\u51fd\u6570 printme(&#8220;\u6211\u8981\u8c03\u7528\u7528\u6237\u81ea\u5b9a\u4e49\u51fd\u6570!&#8221;) printme(&#8220;\u518d\u6b21\u8c03\u7528\u540c\u4e00\u51fd\u6570&#8221;)<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6211\u8981\u8c03\u7528\u7528\u6237\u81ea\u5b9a\u4e49\u51fd\u6570!\n\u518d\u6b21\u8c03\u7528\u540c\u4e00\u51fd\u6570<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u6570\u4f20\u9012<\/h2>\n\n\n\n<p>\u5728 python \u4e2d\uff0c\u7c7b\u578b\u5c5e\u4e8e\u5bf9\u8c61\uff0c\u5bf9\u8c61\u6709\u4e0d\u540c\u7c7b\u578b\u7684\u533a\u5206\uff0c\u53d8\u91cf\u662f\u6ca1\u6709\u7c7b\u578b\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">a=[1,2,3]\n\na=\"Runoob\"<\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u4ee3\u7801\u4e2d\uff0c<strong>[1,2,3]<\/strong>&nbsp;\u662f List \u7c7b\u578b\uff0c<strong>&#8220;Runoob&#8221;<\/strong>&nbsp;\u662f String \u7c7b\u578b\uff0c\u800c\u53d8\u91cf a \u662f\u6ca1\u6709\u7c7b\u578b\uff0c\u5b83\u4ec5\u4ec5\u662f\u4e00\u4e2a\u5bf9\u8c61\u7684\u5f15\u7528\uff08\u4e00\u4e2a\u6307\u9488\uff09\uff0c\u53ef\u4ee5\u662f\u6307\u5411 List \u7c7b\u578b\u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u6307\u5411 String \u7c7b\u578b\u5bf9\u8c61\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53ef\u66f4\u6539(mutable)\u4e0e\u4e0d\u53ef\u66f4\u6539(immutable)\u5bf9\u8c61<\/h3>\n\n\n\n<p>\u5728 python \u4e2d\uff0cstrings, tuples, \u548c numbers \u662f\u4e0d\u53ef\u66f4\u6539\u7684\u5bf9\u8c61\uff0c\u800c list,dict \u7b49\u5219\u662f\u53ef\u4ee5\u4fee\u6539\u7684\u5bf9\u8c61\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0d\u53ef\u53d8\u7c7b\u578b\uff1a<\/strong>\u53d8\u91cf\u8d4b\u503c\u00a0<strong>a=5<\/strong>\u00a0\u540e\u518d\u8d4b\u503c\u00a0<strong>a=10<\/strong>\uff0c\u8fd9\u91cc\u5b9e\u9645\u662f\u65b0\u751f\u6210\u4e00\u4e2a int \u503c\u5bf9\u8c61 10\uff0c\u518d\u8ba9 a \u6307\u5411\u5b83\uff0c\u800c 5 \u88ab\u4e22\u5f03\uff0c\u4e0d\u662f\u6539\u53d8 a \u7684\u503c\uff0c\u76f8\u5f53\u4e8e\u65b0\u751f\u6210\u4e86 a\u3002<\/li>\n\n\n\n<li><strong>\u53ef\u53d8\u7c7b\u578b\uff1a<\/strong>\u53d8\u91cf\u8d4b\u503c\u00a0<strong>la=[1,2,3,4]<\/strong>\u00a0\u540e\u518d\u8d4b\u503c\u00a0<strong>la[2]=5<\/strong>\u00a0\u5219\u662f\u5c06 list la \u7684\u7b2c\u4e09\u4e2a\u5143\u7d20\u503c\u66f4\u6539\uff0c\u672c\u8eabla\u6ca1\u6709\u52a8\uff0c\u53ea\u662f\u5176\u5185\u90e8\u7684\u4e00\u90e8\u5206\u503c\u88ab\u4fee\u6539\u4e86\u3002<\/li>\n<\/ul>\n\n\n\n<p>python \u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0d\u53ef\u53d8\u7c7b\u578b\uff1a<\/strong>\u7c7b\u4f3c C++ \u7684\u503c\u4f20\u9012\uff0c\u5982\u6574\u6570\u3001\u5b57\u7b26\u4e32\u3001\u5143\u7ec4\u3002\u5982 fun(a)\uff0c\u4f20\u9012\u7684\u53ea\u662f a \u7684\u503c\uff0c\u6ca1\u6709\u5f71\u54cd a \u5bf9\u8c61\u672c\u8eab\u3002\u5982\u679c\u5728 fun(a) \u5185\u90e8\u4fee\u6539 a \u7684\u503c\uff0c\u5219\u662f\u65b0\u751f\u6210\u4e00\u4e2a a \u7684\u5bf9\u8c61\u3002<\/li>\n\n\n\n<li><strong>\u53ef\u53d8\u7c7b\u578b\uff1a<\/strong>\u7c7b\u4f3c C++ \u7684\u5f15\u7528\u4f20\u9012\uff0c\u5982 \u5217\u8868\uff0c\u5b57\u5178\u3002\u5982 fun(la)\uff0c\u5219\u662f\u5c06 la \u771f\u6b63\u7684\u4f20\u8fc7\u53bb\uff0c\u4fee\u6539\u540e fun \u5916\u90e8\u7684 la \u4e5f\u4f1a\u53d7\u5f71\u54cd<\/li>\n<\/ul>\n\n\n\n<p>python \u4e2d\u4e00\u5207\u90fd\u662f\u5bf9\u8c61\uff0c\u4e25\u683c\u610f\u4e49\u6211\u4eec\u4e0d\u80fd\u8bf4\u503c\u4f20\u9012\u8fd8\u662f\u5f15\u7528\u4f20\u9012\uff0c\u6211\u4eec\u5e94\u8be5\u8bf4\u4f20\u4e0d\u53ef\u53d8\u5bf9\u8c61\u548c\u4f20\u53ef\u53d8\u5bf9\u8c61\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">python \u4f20\u4e0d\u53ef\u53d8\u5bf9\u8c61\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u901a\u8fc7&nbsp;<strong>id()<\/strong>&nbsp;\u51fd\u6570\u6765\u67e5\u770b\u5185\u5b58\u5730\u5740\u53d8\u5316\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>def change(a): print(id(a)) # \u6307\u5411\u7684\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61 a=10 print(id(a)) # \u4e00\u4e2a\u65b0\u5bf9\u8c61 a=1 print(id(a)) change(a)<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">4379369136\n4379369136\n4379369424<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u89c1\u5728\u8c03\u7528\u51fd\u6570\u524d\u540e\uff0c\u5f62\u53c2\u548c\u5b9e\u53c2\u6307\u5411\u7684\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61\uff08\u5bf9\u8c61 id \u76f8\u540c\uff09\uff0c\u5728\u51fd\u6570\u5185\u90e8\u4fee\u6539\u5f62\u53c2\u540e\uff0c\u5f62\u53c2\u6307\u5411\u7684\u662f\u4e0d\u540c\u7684 id\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f20\u53ef\u53d8\u5bf9\u8c61\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u53ef\u53d8\u5bf9\u8c61\u5728\u51fd\u6570\u91cc\u4fee\u6539\u4e86\u53c2\u6570\uff0c\u90a3\u4e48\u5728\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\u7684\u51fd\u6570\u91cc\uff0c\u539f\u59cb\u7684\u53c2\u6570\u4e5f\u88ab\u6539\u53d8\u4e86\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e def changeme( mylist ): &#8220;\u4fee\u6539\u4f20\u5165\u7684\u5217\u8868&#8221; mylist.append([1,2,3,4]) print (&#8220;\u51fd\u6570\u5185\u53d6\u503c: &#8220;, mylist) return # \u8c03\u7528changeme\u51fd\u6570 mylist = [10,20,30] changeme( mylist ) print (&#8220;\u51fd\u6570\u5916\u53d6\u503c: &#8220;, mylist)<\/p>\n\n\n\n<p>\u4f20\u5165\u51fd\u6570\u7684\u548c\u5728\u672b\u5c3e\u6dfb\u52a0\u65b0\u5185\u5bb9\u7684\u5bf9\u8c61\u7528\u7684\u662f\u540c\u4e00\u4e2a\u5f15\u7528\u3002\u6545\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u51fd\u6570\u5185\u53d6\u503c:  [10, 20, 30, [1, 2, 3, 4]]\n\u51fd\u6570\u5916\u53d6\u503c:  [10, 20, 30, [1, 2, 3, 4]]<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u6570<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u8c03\u7528\u51fd\u6570\u65f6\u53ef\u4f7f\u7528\u7684\u6b63\u5f0f\u53c2\u6570\u7c7b\u578b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5fc5\u9700\u53c2\u6570<\/li>\n\n\n\n<li>\u5173\u952e\u5b57\u53c2\u6570<\/li>\n\n\n\n<li>\u9ed8\u8ba4\u53c2\u6570<\/li>\n\n\n\n<li>\u4e0d\u5b9a\u957f\u53c2\u6570<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5fc5\u9700\u53c2\u6570<\/h3>\n\n\n\n<p>\u5fc5\u9700\u53c2\u6570\u987b\u4ee5\u6b63\u786e\u7684\u987a\u5e8f\u4f20\u5165\u51fd\u6570\u3002\u8c03\u7528\u65f6\u7684\u6570\u91cf\u5fc5\u987b\u548c\u58f0\u660e\u65f6\u7684\u4e00\u6837\u3002<\/p>\n\n\n\n<p>\u8c03\u7528 printme() \u51fd\u6570\uff0c\u4f60\u5fc5\u987b\u4f20\u5165\u4e00\u4e2a\u53c2\u6570\uff0c\u4e0d\u7136\u4f1a\u51fa\u73b0\u8bed\u6cd5\u9519\u8bef\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 #\u53ef\u5199\u51fd\u6570\u8bf4\u660e def printme( str ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u5b57\u7b26\u4e32&#8221; print (str) return # \u8c03\u7528 printme \u51fd\u6570\uff0c\u4e0d\u52a0\u53c2\u6570\u4f1a\u62a5\u9519 printme()<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Traceback (most recent call last):\n  File \"test.py\", line 10, in &lt;module&gt;\n    printme()\nTypeError: printme() missing 1 required positional argument: 'str'<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5173\u952e\u5b57\u53c2\u6570<\/h3>\n\n\n\n<p>\u5173\u952e\u5b57\u53c2\u6570\u548c\u51fd\u6570\u8c03\u7528\u5173\u7cfb\u7d27\u5bc6\uff0c\u51fd\u6570\u8c03\u7528\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u6765\u786e\u5b9a\u4f20\u5165\u7684\u53c2\u6570\u503c\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u5141\u8bb8\u51fd\u6570\u8c03\u7528\u65f6\u53c2\u6570\u7684\u987a\u5e8f\u4e0e\u58f0\u660e\u65f6\u4e0d\u4e00\u81f4\uff0c\u56e0\u4e3a Python \u89e3\u91ca\u5668\u80fd\u591f\u7528\u53c2\u6570\u540d\u5339\u914d\u53c2\u6570\u503c\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u5b9e\u4f8b\u5728\u51fd\u6570 printme() \u8c03\u7528\u65f6\u4f7f\u7528\u53c2\u6570\u540d\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 #\u53ef\u5199\u51fd\u6570\u8bf4\u660e def printme( str ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u5b57\u7b26\u4e32&#8221; print (str) return #\u8c03\u7528printme\u51fd\u6570 printme( str = &#8220;\u83dc\u9e1f\u6559\u7a0b&#8221;)<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u83dc\u9e1f\u6559\u7a0b<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u5b9e\u4f8b\u4e2d\u6f14\u793a\u4e86\u51fd\u6570\u53c2\u6570\u7684\u4f7f\u7528\u4e0d\u9700\u8981\u4f7f\u7528\u6307\u5b9a\u987a\u5e8f\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 #\u53ef\u5199\u51fd\u6570\u8bf4\u660e def printinfo( name, age ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u5b57\u7b26\u4e32&#8221; print (&#8220;\u540d\u5b57: &#8220;, name) print (&#8220;\u5e74\u9f84: &#8220;, age) return #\u8c03\u7528printinfo\u51fd\u6570 printinfo( age=50, name=&#8221;runoob&#8221; )<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u540d\u5b57:  runoob\n\u5e74\u9f84:  50<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u9ed8\u8ba4\u53c2\u6570<\/h3>\n\n\n\n<p>\u8c03\u7528\u51fd\u6570\u65f6\uff0c\u5982\u679c\u6ca1\u6709\u4f20\u9012\u53c2\u6570\uff0c\u5219\u4f1a\u4f7f\u7528\u9ed8\u8ba4\u53c2\u6570\u3002\u4ee5\u4e0b\u5b9e\u4f8b\u4e2d\u5982\u679c\u6ca1\u6709\u4f20\u5165 age \u53c2\u6570\uff0c\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 #\u53ef\u5199\u51fd\u6570\u8bf4\u660e def printinfo( name, age = 35 ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u5b57\u7b26\u4e32&#8221; print (&#8220;\u540d\u5b57: &#8220;, name) print (&#8220;\u5e74\u9f84: &#8220;, age) return #\u8c03\u7528printinfo\u51fd\u6570 printinfo( age=50, name=&#8221;runoob&#8221; ) print (&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8220;) printinfo( name=&#8221;runoob&#8221; )<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u540d\u5b57:  runoob\n\u5e74\u9f84:  50\n------------------------\n\u540d\u5b57:  runoob\n\u5e74\u9f84:  35<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0d\u5b9a\u957f\u53c2\u6570<\/h3>\n\n\n\n<p>\u4f60\u53ef\u80fd\u9700\u8981\u4e00\u4e2a\u51fd\u6570\u80fd\u5904\u7406\u6bd4\u5f53\u521d\u58f0\u660e\u65f6\u66f4\u591a\u7684\u53c2\u6570\u3002\u8fd9\u4e9b\u53c2\u6570\u53eb\u505a\u4e0d\u5b9a\u957f\u53c2\u6570\uff0c\u548c\u4e0a\u8ff0 2 \u79cd\u53c2\u6570\u4e0d\u540c\uff0c\u58f0\u660e\u65f6\u4e0d\u4f1a\u547d\u540d\u3002\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def functionname([formal_args,] *var_args_tuple ):\n   \"\u51fd\u6570_\u6587\u6863\u5b57\u7b26\u4e32\"\n   function_suite\n   return [expression]<\/pre>\n\n\n\n<p>\u52a0\u4e86\u661f\u53f7&nbsp;<strong>*<\/strong>&nbsp;\u7684\u53c2\u6570\u4f1a\u4ee5\u5143\u7ec4(tuple)\u7684\u5f62\u5f0f\u5bfc\u5165\uff0c\u5b58\u653e\u6240\u6709\u672a\u547d\u540d\u7684\u53d8\u91cf\u53c2\u6570\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e def printinfo( arg1, *vartuple ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u53c2\u6570&#8221; print (&#8220;\u8f93\u51fa: &#8220;) print (arg1) print (vartuple) # \u8c03\u7528printinfo \u51fd\u6570 printinfo( 70, 60, 50 )<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8f93\u51fa: \n70\n(60, 50)<\/pre>\n\n\n\n<p>\u5982\u679c\u5728\u51fd\u6570\u8c03\u7528\u65f6\u6ca1\u6709\u6307\u5b9a\u53c2\u6570\uff0c\u5b83\u5c31\u662f\u4e00\u4e2a\u7a7a\u5143\u7ec4\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u4e0d\u5411\u51fd\u6570\u4f20\u9012\u672a\u547d\u540d\u7684\u53d8\u91cf\u3002\u5982\u4e0b\u5b9e\u4f8b\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e def printinfo( arg1, *vartuple ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u53c2\u6570&#8221; print (&#8220;\u8f93\u51fa: &#8220;) print (arg1) for var in vartuple: print (var) return # \u8c03\u7528printinfo \u51fd\u6570 printinfo( 10 ) printinfo( 70, 60, 50 )<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8f93\u51fa:\n10\n\u8f93\u51fa:\n70\n60\n50<\/pre>\n\n\n\n<p>\u8fd8\u6709\u4e00\u79cd\u5c31\u662f\u53c2\u6570\u5e26\u4e24\u4e2a\u661f\u53f7&nbsp;<strong>**<\/strong>\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def functionname([formal_args,] **var_args_dict ):\n   \"\u51fd\u6570_\u6587\u6863\u5b57\u7b26\u4e32\"\n   function_suite\n   return [expression]<\/pre>\n\n\n\n<p>\u52a0\u4e86\u4e24\u4e2a\u661f\u53f7&nbsp;<strong>**<\/strong>&nbsp;\u7684\u53c2\u6570\u4f1a\u4ee5\u5b57\u5178\u7684\u5f62\u5f0f\u5bfc\u5165\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e def printinfo( arg1, **vardict ): &#8220;\u6253\u5370\u4efb\u4f55\u4f20\u5165\u7684\u53c2\u6570&#8221; print (&#8220;\u8f93\u51fa: &#8220;) print (arg1) print (vardict) # \u8c03\u7528printinfo \u51fd\u6570 printinfo(1, a=2,b=3)<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8f93\u51fa: \n1\n{'a': 2, 'b': 3}<\/pre>\n\n\n\n<p>\u58f0\u660e\u51fd\u6570\u65f6\uff0c\u53c2\u6570\u4e2d\u661f\u53f7&nbsp;<strong>*<\/strong>&nbsp;\u53ef\u4ee5\u5355\u72ec\u51fa\u73b0\uff0c\u4f8b\u5982:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def f(a,b,*,c):\n    return a+b+c<\/pre>\n\n\n\n<p>\u5982\u679c\u5355\u72ec\u51fa\u73b0\u661f\u53f7&nbsp;<strong>*<\/strong>\uff0c\u5219\u661f\u53f7&nbsp;<strong>*<\/strong>&nbsp;\u540e\u7684\u53c2\u6570\u5fc5\u987b\u7528\u5173\u952e\u5b57\u4f20\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;&gt;&gt; def f(a,b,*,c):\n...     return a+b+c\n... \n&gt;&gt;&gt; f(1,2,3)   # \u62a5\u9519\nTraceback (most recent call last):\n  File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\nTypeError: f() takes 2 positional arguments but 3 were given\n&gt;&gt;&gt; f(1,2,c=3) # \u6b63\u5e38\n6\n&gt;&gt;&gt;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u533f\u540d\u51fd\u6570<\/h2>\n\n\n\n<p>Python \u4f7f\u7528&nbsp;<strong>lambda<\/strong>&nbsp;\u6765\u521b\u5efa\u533f\u540d\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u6240\u8c13\u533f\u540d\uff0c\u610f\u5373\u4e0d\u518d\u4f7f\u7528&nbsp;<strong>def<\/strong>&nbsp;\u8bed\u53e5\u8fd9\u6837\u6807\u51c6\u7684\u5f62\u5f0f\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>lambda<\/strong>\u00a0\u53ea\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u51fd\u6570\u4f53\u6bd4\u00a0<strong>def<\/strong>\u00a0\u7b80\u5355\u5f88\u591a\u3002<\/li>\n\n\n\n<li>lambda \u7684\u4e3b\u4f53\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u800c\u4e0d\u662f\u4e00\u4e2a\u4ee3\u7801\u5757\u3002\u4ec5\u4ec5\u80fd\u5728 lambda \u8868\u8fbe\u5f0f\u4e2d\u5c01\u88c5\u6709\u9650\u7684\u903b\u8f91\u8fdb\u53bb\u3002<\/li>\n\n\n\n<li>lambda \u51fd\u6570\u62e5\u6709\u81ea\u5df1\u7684\u547d\u540d\u7a7a\u95f4\uff0c\u4e14\u4e0d\u80fd\u8bbf\u95ee\u81ea\u5df1\u53c2\u6570\u5217\u8868\u4e4b\u5916\u6216\u5168\u5c40\u547d\u540d\u7a7a\u95f4\u91cc\u7684\u53c2\u6570\u3002<\/li>\n\n\n\n<li>\u867d\u7136 lambda \u51fd\u6570\u770b\u8d77\u6765\u53ea\u80fd\u5199\u4e00\u884c\uff0c\u5374\u4e0d\u7b49\u540c\u4e8e C \u6216 C++ \u7684\u5185\u8054\u51fd\u6570\uff0c\u5185\u8054\u51fd\u6570\u7684\u76ee\u7684\u662f\u8c03\u7528\u5c0f\u51fd\u6570\u65f6\u4e0d\u5360\u7528\u6808\u5185\u5b58\u4ece\u800c\u51cf\u5c11\u51fd\u6570\u8c03\u7528\u7684\u5f00\u9500\uff0c\u63d0\u9ad8\u4ee3\u7801\u7684\u6267\u884c\u901f\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u8bed\u6cd5<\/h3>\n\n\n\n<p>lambda \u51fd\u6570\u7684\u8bed\u6cd5\u53ea\u5305\u542b\u4e00\u4e2a\u8bed\u53e5\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lambda [arg1 [,arg2,.....argn]]:expression<\/pre>\n\n\n\n<p>\u8bbe\u7f6e\u53c2\u6570 a \u52a0\u4e0a 10:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b<\/h2>\n\n\n\n<p>x = lambda a : a + 10 print(x(5))<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">15<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u5b9e\u4f8b\u533f\u540d\u51fd\u6570\u8bbe\u7f6e\u4e24\u4e2a\u53c2\u6570\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e sum = lambda arg1, arg2: arg1 + arg2 # \u8c03\u7528sum\u51fd\u6570 print (&#8220;\u76f8\u52a0\u540e\u7684\u503c\u4e3a : &#8220;, sum( 10, 20 )) print (&#8220;\u76f8\u52a0\u540e\u7684\u503c\u4e3a : &#8220;, sum( 20, 20 ))<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u76f8\u52a0\u540e\u7684\u503c\u4e3a :  30\n\u76f8\u52a0\u540e\u7684\u503c\u4e3a :  40<\/pre>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u5c06\u533f\u540d\u51fd\u6570\u5c01\u88c5\u5728\u4e00\u4e2a\u51fd\u6570\u5185\uff0c\u8fd9\u6837\u53ef\u4ee5\u4f7f\u7528\u540c\u6837\u7684\u4ee3\u7801\u6765\u521b\u5efa\u591a\u4e2a\u533f\u540d\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u5b9e\u4f8b\u5c06\u533f\u540d\u51fd\u6570\u5c01\u88c5\u5728 myfunc \u51fd\u6570\u4e2d\uff0c\u901a\u8fc7\u4f20\u5165\u4e0d\u540c\u7684\u53c2\u6570\u6765\u521b\u5efa\u4e0d\u540c\u7684\u533f\u540d\u51fd\u6570\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b<\/h2>\n\n\n\n<p>def myfunc(n): return lambda a : a * n mydoubler = myfunc(2) mytripler = myfunc(3) print(mydoubler(11)) print(mytripler(11))<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">22\n33<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">return \u8bed\u53e5<\/h2>\n\n\n\n<p><strong>return [\u8868\u8fbe\u5f0f]<\/strong>&nbsp;\u8bed\u53e5\u7528\u4e8e\u9000\u51fa\u51fd\u6570\uff0c\u9009\u62e9\u6027\u5730\u5411\u8c03\u7528\u65b9\u8fd4\u56de\u4e00\u4e2a\u8868\u8fbe\u5f0f\u3002\u4e0d\u5e26\u53c2\u6570\u503c\u7684 return \u8bed\u53e5\u8fd4\u56de None\u3002\u4e4b\u524d\u7684\u4f8b\u5b50\u90fd\u6ca1\u6709\u793a\u8303\u5982\u4f55\u8fd4\u56de\u6570\u503c\uff0c\u4ee5\u4e0b\u5b9e\u4f8b\u6f14\u793a\u4e86 return \u8bed\u53e5\u7684\u7528\u6cd5\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u4f8b(Python 3.0+)<\/h2>\n\n\n\n<p>#!\/usr\/bin\/python3 # \u53ef\u5199\u51fd\u6570\u8bf4\u660e def sum( arg1, arg2 ): # \u8fd4\u56de2\u4e2a\u53c2\u6570\u7684\u548c.&#8221; total = arg1 + arg2 print (&#8220;\u51fd\u6570\u5185 : &#8220;, total) return total # \u8c03\u7528sum\u51fd\u6570 total = sum( 10, 20 ) print (&#8220;\u51fd\u6570\u5916 : &#8220;, total)<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u5b9e\u4f8b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u51fd\u6570\u5185 :  30\n\u51fd\u6570\u5916 :  30<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f3a\u5236\u4f4d\u7f6e\u53c2\u6570<\/h2>\n\n\n\n<p>Python3.8 \u65b0\u589e\u4e86\u4e00\u4e2a\u51fd\u6570\u5f62\u53c2\u8bed\u6cd5 \/ \u7528\u6765\u6307\u660e\u51fd\u6570\u5f62\u53c2\u5fc5\u987b\u4f7f\u7528\u6307\u5b9a\u4f4d\u7f6e\u53c2\u6570\uff0c\u4e0d\u80fd\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u7684\u5f62\u5f0f\u3002\u5728\u4ee5\u4e0b\u7684\u4f8b\u5b50\u4e2d\uff0c\u5f62\u53c2 a \u548c b \u5fc5\u987b\u4f7f\u7528\u6307\u5b9a\u4f4d\u7f6e\u53c2\u6570\uff0cc \u6216 d \u53ef\u4ee5\u662f\u4f4d\u7f6e\u5f62\u53c2\u6216\u5173\u952e\u5b57\u5f62\u53c2\uff0c\u800c e \u548c f \u8981\u6c42\u4e3a\u5173\u952e\u5b57\u5f62\u53c2:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def f(a, b, \/, c, d, *, e, f):\n    print(a, b, c, d, e, f)<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u4f7f\u7528\u65b9\u6cd5\u662f\u6b63\u786e\u7684:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">f(10, 20, 30, d=40, e=50, f=60)<\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u4f7f\u7528\u65b9\u6cd5\u4f1a\u53d1\u751f\u9519\u8bef:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">f(10, b=20, c=30, d=40, e=50, f=60)   # b \u4e0d\u80fd\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u7684\u5f62\u5f0f\nf(10, 20, 30, 40, 50, f=60)           # e \u5fc5\u987b\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\u7684\u5f62\u5f0f<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u51fd\u6570\u662f\u7ec4\u7ec7\u597d\u7684\uff0c\u53ef\u91cd\u590d\u4f7f\u7528\u7684\uff0c\u7528\u6765\u5b9e\u73b0\u5355\u4e00\uff0c\u6216\u76f8\u5173\u8054\u529f\u80fd\u7684\u4ee3\u7801\u6bb5\u3002 &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-566","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"views":448,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=566"}],"version-history":[{"count":1,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":567,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/566\/revisions\/567"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/489"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}