{"id":95950,"date":"2020-04-07T05:27:00","date_gmt":"2020-04-06T21:27:00","guid":{"rendered":"http:\/\/4563.org\/?p=95950"},"modified":"2020-04-07T05:27:00","modified_gmt":"2020-04-06T21:27:00","slug":"python-%e7%9a%84range17-range26-16-1-%e6%98%af%e4%bb%80%e4%b9%88%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=95950","title":{"rendered":"Python \u7684[*range(17), *range(26, 16, -1)] \u662f\u4ec0\u4e48\u64cd\u4f5c?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python \u7684[*range(17), *range(26, 16, -1)] \u662f\u4ec0\u4e48\u64cd\u4f5c?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fyooo <\/span>  <span><i><\/i> 59<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u8fd9\u91cc \u770b\u5230\u7684\u4f8b\u5b50 :<\/p>\n<pre><code>outline = landmarks[[*range(17), *range(26,16,-1)]] <\/code><\/pre>\n<p>\u770b\u4e0d\u61c2\u5176\u4e2d\u7684\u6570\u7ec4\u64cd\u4f5c\u7b26 <code>*range<\/code> \uff0c\u6709\u540c\u884c\u53ef\u4ee5\u7ed9\u4e2a\u63d0\u793a\u4e48?<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"843457\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DGideas <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/docs.python.org\/3.7\/tutorial\/controlflow.html#unpacking-argument-lists                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"843458\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DGideas <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728\u4f60\u7684\u4f8b\u5b50\u4e2d\uff0c\u5373\u5c06\u4e24\u4e2a range()\u751f\u6210\u7684\u5e8f\u5217\uff08\u4e24\u4e2a list \u5bf9\u8c61\uff09\u89e3\u5305\uff0c\u5e76\u5408\u5e76\u4e3a\u4e00\u4e2a list                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"843459\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Takamine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u89e3\u5305\u3002~                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"843460\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hbl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u4e2a\u661f\u53f7\u662f\u89e3\u5217\u8868\u3002\u4e24\u4e2a\u661f\u53f7\u662f\u89e3\u5b57\u5178\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"843461\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jdhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53eb\u505a unpacking\uff0c\u5982\u4e0a\u6240\u8bf4\uff0c\u4e00\u4e2a * \u662f\u628a\u5217\u8868\u7684\u5143\u7d20\u62ff\u51fa\u6765\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"843462\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : di94sh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             []\u548c list \u662f\u7b49\u4ef7\u7684[*args\uff0c*args_2]\u548c list(*args\uff0c*args_2)\u662f\u7b49\u4ef7\u7684\uff0c\u53c2\u8003 Python \u661f\u53f7\u6536\u96c6\u548c\u5c55\u5f00                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python \u7684[*range(1&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/95950"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=95950"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/95950\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=95950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=95950"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=95950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}