{"id":1591,"date":"2020-06-14T14:17:30","date_gmt":"2020-06-14T06:17:30","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=1591"},"modified":"2020-06-14T14:18:02","modified_gmt":"2020-06-14T06:18:02","slug":"sequence","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2020\/06\/14\/sequence\/","title":{"rendered":"python\u5e8f\u5217"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5e8f\u5217\u662f\u4e00\u5757\u7528\u4e8e\u5b58\u653e\u591a\u4e2a\u503c\u7684\u8fde\u7eed\u5185\u5b58\u7a7a\u95f4\uff0c\u5e76\u4e14\u6309\u7167\u4e00\u5b9a\u987a\u5e8f\u6392\u5217\uff0c\uff0c\u6bcf\u4e00\u4e2a\u503c(\u5143\u7d20)\u90fd\u5206\u914d\u4e00\u4e2a\u6570\u5b57\uff0c\u79f0\u4e3a\u7d22\u5f15\u6216\u4f4d\u7f6e\uff0c\u901a\u8fc7\u8be5\u7d22\u5f15\u53ef\u4ee5\u53d6\u51fa\u5bf9\u5e94\u7684\u503c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python\u4e2d\uff0c\u5e8f\u5217\u7ed3\u6784\u4e3b\u8981\u6709\u5217\u8868\u3001\u5143\u7956\u3001\u96c6\u5408\u3001\u5b57\u5178\u548c\u5b57\u7b26\u4e32\uff0c\u5176\u4e2d\u96c6\u5408\u548c\u5b57\u5178\u4e0d\u652f\u6301\u7d22\u5f15\u3001\u5207\u7247\u3001\u76f8\u52a0\u548c\u76f8\u4e58\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1\u3001\u7d22\u5f15:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e8f\u5217\u4e2d\u6bcf\u4e2a\u5143\u7d20\u90fd\u6709\u4e00\u4e2a\u7f16\u53f7\uff0c\u79f0\u4e3a\u7d22\u5f15\uff0c\u7d22\u5f15\u662f\u4ece0\u5f00\u59cb\u9012\u589e\u7684\uff0c\u5373\u4e0b\u6807\u4e3a0\u8868\u793a\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u4e0b\u6807\u4e3a1\u8868\u793a\u7b2c\u4e8c\u4e2a\u5143\u7d20\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"572\" height=\"149\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/9.png\" alt=\"\" class=\"wp-image-1592\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/9.png 572w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/9-300x78.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u7d22\u5f15\u4e5f\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u4ece\u53f3\u4fa7\u7b2c\u4e00\u4e2a\u5f00\u59cb\uff0c\u7d22\u5f15\u4e3a-1\uff0c\u8868\u793a\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u7684\u7d22\u5f15\u4e3a-2\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"122\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/10.png\" alt=\"\" class=\"wp-image-1593\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/10.png 604w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/10-300x61.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/10-600x121.png 600w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/figure>\n\n\n\n<p class=\"has-background has-luminous-vivid-amber-background-color wp-block-paragraph\">\u6ce8\u610f\uff1a\u5728\u4f7f\u7528\u8d1f\u6570\u4f5c\u4e3a\u7d22\u5f15\u7684\u65f6\u5019\uff0c\u662f\u4ece-1\u5f00\u59cb\u7684\uff0c\u4e0d\u662f\u4ece0\u5f00\u59cb<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u7d22\u5f15\u53ef\u4ee5\u8bbf\u95ee\u5e8f\u5217\u4e2d\u7684\u4efb\u4f55\u5143\u7d20\uff0c\u8bbf\u95ee\u5e8f\u5217\u7684\u7b2c\u4e8c\u4e2a\u548c\u7b2c\u4e94\u4e2a\u5143\u7d20\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"491\" height=\"145\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/11.png\" alt=\"\" class=\"wp-image-1595\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/11.png 491w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/11-300x89.png 300w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2\u3001\u5207\u7247\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5207\u7247\u53ef\u4ee5\u8bbf\u95ee\u4e00\u5b9a\u8303\u56f4\u5185\u7684\u5143\u7d20\uff0c\u901a\u8fc7\u5207\u7247\u53ef\u4ee5\u751f\u6210\u65b0\u7684\u5e8f\u5217\uff0c\u8bed\u6cd5\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sname[start : end : step]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>sname:\u8868\u793a\u5e8f\u5217\u540d\u79f0\u3002<\/li><li>start\uff1a\u5207\u7247\u7684\u8d77\u59cb\u4f4d\u7f6e(\u5305\u62ec\u8be5\u4f4d\u7f6e)\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u9ed8\u8ba4\u4ece0\u5f00\u59cb\u3002<\/li><li>end: \u5207\u7247\u7684\u7ed3\u675f\u4f4d\u7f6e(\u4e0d\u5305\u542b\u8be5\u4f4d\u7f6e)\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u9ed8\u8ba4\u4e3a\u5e8f\u5217\u7684\u957f\u5ea6\u3002<\/li><li>step\uff1a\u5207\u7247\u7684\u6b65\u957f\uff0c\u4e0d\u6307\u5b9a\u9ed8\u8ba4\u4e3a1\uff0c\u5982\u679c\u7701\u7565\uff0c\u6700\u540e\u4e00\u4e2a\u5192\u53f7\u4e5f\u53ef\u4ee5\u7701\u7565\u3002<\/li><\/ol>\n\n\n\n<p class=\"has-background has-luminous-vivid-amber-background-color wp-block-paragraph\">\u6ce8\u610f\uff1a\u5728\u8fdb\u884c\u5207\u7247\u64cd\u4f5c\u65f6\uff0c\u5982\u679c\u6307\u5b9a\u4e86\u6b65\u957f\uff0c\u90a3\u4e48\u5c06\u6309\u7167\u8be5\u6b65\u957f\u904d\u5386\u5143\u7d20\uff0c\u5426\u5219\u5c06\u4e00\u4e2a\u4e00\u4e2a\u904d\u5386\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u901a\u8fc7\u5207\u7247\u83b7\u53d6\u5217\u8868\u4e2d\u7b2c2\u52306\u7684\u5143\u7d20\uff0c\u518d\u83b7\u53d6\u7b2c\u4e00\u4e2a\u3001\u7b2c\u4e09\u4e2a\u3001\u7b2c\u4e94\u4e2a\u3001\u7b2c\u4e03\u4e2a\u5143\u7d20\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"120\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/13.png\" alt=\"\" class=\"wp-image-1599\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/13.png 510w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/13-300x71.png 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8981\u6253\u5370\u6574\u4e2a\u5e8f\u5217\uff0c\u53ea\u9700\u8981\u5c06start\u548cend\u7701\u7565\uff0c\u4f46\u662f\u4e2d\u95f4\u7684\u5192\u53f7\u4fdd\u7559\u5373\u53ef\uff0c\u5982\u4e0a\u56fe\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3\u3001\u5e8f\u5217\u76f8\u52a0\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python\u4e2d\uff0c\u652f\u6301\u4e24\u79cd\u76f8\u540c\u7c7b\u578b\u7684\u5e8f\u5217\u8fdb\u884c\u76f8\u52a0\u64cd\u4f5c\uff0c\u5373\u5c06\u4e24\u4e2a\u5e8f\u5217\u8fdb\u884c\u8fde\u63a5\uff0c\u4e0d\u4f1a\u53bb\u9664\u91cd\u590d\u7684\u5143\u7d20\uff0c\u4f7f\u7528\u8fd0\u7b97\u7b26(+)\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u5c06\u4e24\u4e2a\u5217\u8868\u8fdb\u884c\u76f8\u52a0\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"152\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/14.png\" alt=\"\" class=\"wp-image-1600\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/14.png 496w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/14-300x92.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/figure>\n\n\n\n<p class=\"has-background has-luminous-vivid-amber-background-color wp-block-paragraph\">\u6ce8\u610f\uff1a\u76f8\u540c\u7c7b\u578b\u7684\u5e8f\u5217\u6307\u7684\u662f\u540c\u4e3a\u5217\u8868\uff0c\u6216\u8005\u540c\u4e3a\u5143\u7956\u3001\u96c6\u5408\u7b49\uff0c\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\u53ef\u4ee5\u4e0d\u540c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u5c06\u4e24\u4e2a\u5217\u8868\u76f8\u52a0\uff0c\u5176\u4e2d\u4e00\u4e2a\u5217\u8868\u4e3a\u5b57\u7b26\u4e32\uff0c\u4e00\u4e2a\u4e3a\u6570\u5b57\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"137\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/15.png\" alt=\"\" class=\"wp-image-1601\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/15.png 492w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/15-300x84.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u80fd\u5c06\u5217\u8868\u548c\u5143\u7956\u76f8\u52a0\uff0c\u4e5f\u4e0d\u80fd\u5c06\u5217\u8868\u4e0e\u5b57\u7b26\u4e32\u76f8\u52a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u4e0b\u9762\u5c06\u5217\u8868\u4e0e\u5b57\u7b26\u4e32\u76f8\u52a0\u5c06\u4f1a\u62a5\u9519\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"107\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/16.png\" alt=\"\" class=\"wp-image-1602\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/16.png 500w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/16-300x64.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4\u3001\u4e58\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Python\u4e2d\uff0c\u4f7f\u7528\u6570\u5b57n\u4e58\u4ee5\u4e00\u4e2a\u5e8f\u5217\uff0c\u5c06\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5e8f\u5217\uff0c\u65b0\u5e8f\u5217\u7684\u5185\u5bb9\u4e3a\u539f\u6765\u7684\u5e8f\u5217\u88ab\u91cd\u590dn\u6b21\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u5c06\u5217\u8868abc\u4e58\u4ee53\uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5c06\u662f\u539f\u5185\u5bb9\u91cd\u590d\u4e09\u6b21\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"501\" height=\"126\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/17-1.png\" alt=\"\" class=\"wp-image-1604\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/17-1.png 501w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/17-1-300x75.png 300w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5728\u539f\u5217\u8868\u4f4d\u7f6e\u4e58\u4ee53\uff0c\u5e76\u6253\u5370\u7ed3\u679c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"124\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/18.png\" alt=\"\" class=\"wp-image-1605\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/18.png 499w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/18-300x75.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u5b9e\u73b0\u521d\u59cb\u5316\u6307\u5b9a\u957f\u5ea6\u5217\u8868\u7684\u529f\u80fd\uff0c\u4f8b\u5982\uff0c\u6307\u5b9a\u957f\u5ea6\u4e3a5\u7684\u5217\u8868\uff0c\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u662fNone\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"117\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/19.png\" alt=\"\" class=\"wp-image-1607\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/19.png 499w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/19-300x70.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5\u3001\u68c0\u67e5\u67d0\u4e2a\u5143\u7d20\u662f\u5426\u662f\u5e8f\u5217\u4e2d\u7684\u6210\u5458:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Python\u4e2d\uff0c\u4f7f\u7528in\u5173\u952e\u5b57\u68c0\u67e5\u67d0\u4e2a\u5143\u7d20\u662f\u5426\u4e3a\u5e8f\u5217\u4e2d\u7684\u6210\u5458\uff0c\u8bed\u6cd5\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">value  in sequence<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4e2dvalue\u8868\u793a\u8981\u68c0\u67e5\u7684\u5143\u7d20\uff0csequence\u8868\u793a\u6307\u5b9a\u7684\u5e8f\u5217\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u68c0\u67e5\u5143\u7d20var\u662f\u5426\u5728\u5e8f\u5217abc\u4e2d\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"121\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/20-1.png\" alt=\"\" class=\"wp-image-1608\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/20-1.png 495w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/20-1-300x73.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u56fe\u4e2d\u7684\u4ee3\u7801\u6267\u884c\u540e\uff0c\u8fd4\u56de\u7ed3\u679c\u4e3aTrue\uff0c\u8868\u793a\u5e8f\u5217\u4e2d\u5b58\u5728\u6b64\u5143\u7d20\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728python\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7not in \u68c0\u67e5\u67d0\u4e2a\u5143\u7d20\u662f\u5426\u4e0d\u5728\u67d0\u4e2a\u5e8f\u5217\u4e2d\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"129\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/21.png\" alt=\"\" class=\"wp-image-1609\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/21.png 492w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/21-300x79.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">6<strong>\u3001\u8ba1\u7b97\u5e8f\u5217\u7684\u957f\u5ea6\u3001\u6700\u5927\u503c\u3001\u6700\u5c0f\u503c\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Python\u4e2d\u4f7f\u7528\u5185\u7f6e\u51fd\u6570len()\u6765\u8ba1\u7b97\u5e8f\u5217\u7684\u957f\u5ea6\uff0c\u4f7f\u7528max()\u51fd\u6570\u6765\u8ba1\u7b97\u5e8f\u5217\u4e2d\u7684\u6700\u5927\u503c\uff0c\u4f7f\u7528min()\u51fd\u6570\u6765\u8ba1\u7b97\u5e8f\u5217\u4e2d\u7684\u6700\u5c0f\u503c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a\u8fd4\u56de\u5e8f\u5217\u4e2d\u7684\u957f\u5ea6\u3001\u6700\u5927\u503c\u4ee5\u53ca\u6700\u5c0f\u503c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"494\" height=\"147\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/22.png\" alt=\"\" class=\"wp-image-1611\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/22.png 494w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2020\/06\/22-300x89.png 300w\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Python\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u51fd\u6570\uff0c\u5982\u4e0b\u8868\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">\u51fd\u6570<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4f5c\u7528<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">enumerate()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5c06\u5e8f\u5217\u7ec4\u5408\u4e3a\u4e00\u4e2a\u7d22\u5f15\u5e8f\u5217\uff0c\u591a\u7528\u4e8efor\u5faa\u73af\u4e2d<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">list()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5c06\u5e8f\u5217\u8f6c\u6362\u4e3a\u5217\u8868<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">str()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5c06\u5e8f\u5217\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">sum()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8ba1\u7b97\u5143\u7d20\u7684\u548c<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">sorted()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5bf9\u5143\u7d20\u8fdb\u884c\u6392\u5e8f<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">reversed()<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u53cd\u5411\u5e8f\u5217\u4e2d\u7684\u5143\u7d20<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e8f\u5217\u662f\u4e00\u5757\u7528\u4e8e\u5b58\u653e\u591a\u4e2a\u503c\u7684\u8fde\u7eed\u5185\u5b58\u7a7a\u95f4\uff0c\u5e76\u4e14\u6309\u7167\u4e00\u5b9a\u987a\u5e8f\u6392\u5217\uff0c\uff0c\u6bcf\u4e00\u4e2a\u503c(\u5143\u7d20)\u90fd\u5206\u914d\u4e00\u4e2a\u6570\u5b57\uff0c\u79f0\u4e3a\u7d22\u5f15\u6216\u4f4d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1613,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,29],"tags":[85],"class_list":["post-1591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-yunwei","tag-sequence"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/1591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1591"}],"version-history":[{"count":6,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/1591\/revisions"}],"predecessor-version":[{"id":1612,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/1591\/revisions\/1612"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/1613"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}