{"id":1570,"date":"2022-05-28T02:42:44","date_gmt":"2022-05-27T18:42:44","guid":{"rendered":"https:\/\/www.xinot.icu\/?p=1570"},"modified":"2022-05-28T02:47:30","modified_gmt":"2022-05-27T18:47:30","slug":"python%e5%9f%ba%e7%a1%80%e8%af%ad%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.xinot.icu\/?p=1570","title":{"rendered":"Python\u57fa\u7840\u8bed\u6cd5"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1570\" class=\"elementor elementor-1570\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8191dbc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8191dbc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-eb18154\" data-id=\"eb18154\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-111bf95 elementor-widget elementor-widget-heading\" data-id=\"111bf95\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Python\u57fa\u7840\u8bed\u6cd5<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ef47243 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ef47243\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a215915\" data-id=\"a215915\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8462f69 elementor-widget elementor-widget-heading\" data-id=\"8462f69\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u524d\u8a00<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3389821 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"3389821\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-65b8100 elementor-widget elementor-widget-text-editor\" data-id=\"65b8100\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p class=\"MsoNormal\">\u3000\u3000\u8fd9\u9635\u5b50\u62a5\u540d\u4e86\u5b66\u6821\u4e00\u4e2a\u6bd4\u8d5b\uff0c\u662f\u6570\u636e\u7edf\u8ba1\u76f8\u5173\u7684\uff0c\u91cc\u9762\u9700\u8981\u5b66\u4e60\u5230<span lang=\"EN-US\">Python<\/span>\u722c\u866b\u76f8\u5173\u77e5\u8bc6\uff0c\u4e8e\u662f\u5f00\u59cb\u4e86<span lang=\"EN-US\">Python<\/span>\u7684\u5b66\u4e60\u4e4b\u65c5\u3002\u867d\u7136\u4e4b\u524d\u63a5\u89e6\u8fc7\u4f46\u4e0d\u662f\u6df1\u5165\u7684\u4ed4\u7ec6\u5b66\u4e60\uff0c\u5b66\u4e60\u4e00\u6bb5\u65f6\u95f4\u540e\u53d1\u73b0\u8bb8\u591a\u6709\u610f\u601d\u7684\u7279\u5f81\uff0c\u5728\u6b64\u4f5c\u4e0b\u8bb0\u5f55\u52a0\u6df1\u8bb0\u5fc6\uff0c\u540c\u65f6\u65b9\u4fbf\u4ee5\u540e\u56de\u987e\u3002<\/p>\n<p class=\"MsoNormal\">\u3000\u3000\u6ce8\uff1a\u672c\u6587\u57fa\u4e8ePython3.0\u53ca\u4ee5\u4e0a\u7248\u672c\u4f5c\u8ba8\u8bba\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0af5912 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0af5912\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6ce3ec4\" data-id=\"6ce3ec4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-40f6c24 elementor-widget elementor-widget-heading\" data-id=\"40f6c24\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u7b80\u4ecb<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2ad8d20 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"2ad8d20\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4c6c8e4 elementor-widget elementor-widget-text-editor\" data-id=\"4c6c8e4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>\u3000\u3000\u8be5\u8bed\u8a00\u662f\u7531\u8377\u5170\u8457\u540d\u7684\u201c\u9f9f\u53d4\u201d<span lang=\"EN-US\">Guido van Rossum<\/span>\u5728<span lang=\"EN-US\">1989<\/span>\u5e74\u5723\u8bde\u8282\u671f\u95f4\u8bbe\u8ba1\u7684\u7f16\u7a0b\u8bed\u8a00\u3002<span lang=\"EN-US\">2021<\/span>\u5e74\u5341\u6708\uff0c<span lang=\"EN-US\">Tiobe<\/span>\u6392\u884c\u699c\u4e2d<span lang=\"EN-US\">Python<\/span>\u7684\u53d7\u6b22\u996e\u7a0b\u5ea6\u4e0a\u5347\u81f3\u7b2c\u4e00\u540d\uff0c\u5728<span lang=\"EN-US\">Java<\/span>\u548c<span lang=\"EN-US\">C<\/span>\u4e4b\u4e0a\uff0c\u53ef\u89c1<span lang=\"EN-US\">Python<\/span>\u5728\u8fd1\u5e74\u6765\u7684\u70ed\u5ea6\u3002<\/p><p>\u3000\u3000\u76f8\u5bf9\u4e8e<span lang=\"EN-US\">Java<\/span>\u548c<span lang=\"EN-US\">C<\/span>\uff0c<span lang=\"EN-US\">Python<\/span>\u662f\u66f4\u52a0\u300c\u9ad8\u7ea7\u300d\u7684\u8bed\u8a00\uff0c\u5b9e\u73b0\u540c\u4e00\u4e2a\u529f\u80fd\uff0c<span lang=\"EN-US\">C<\/span>\u6216\u8bb8\u8981<span lang=\"EN-US\">500<\/span>\u884c\u4ee3\u7801\uff0c<span lang=\"EN-US\">Java<\/span>\u9700\u8981<span lang=\"EN-US\">100<\/span>\u884c\u4ee3\u7801\uff0c\u800c<span lang=\"EN-US\">Python<\/span>\u53ef\u80fd\u53ea\u8981<span lang=\"EN-US\">50<\/span>\u884c\u3002\u4f46\u4ee3\u7801\u5c11\u7684\u4ee3\u4ef7\u5c31\u662f\u8fd0\u884c\u901f\u5ea6\u6162\uff0c<span lang=\"EN-US\">C<\/span>\u7a0b\u5e8f\u8fd0\u884c\u9700\u8981<span lang=\"EN-US\">0.1<\/span>\u79d2\uff0c<span lang=\"EN-US\">Java<\/span>\u9700\u8981<span lang=\"EN-US\">1<\/span>\u79d2\uff0c<span lang=\"EN-US\">Python<\/span>\u6216\u8bb8\u5c31\u9700\u8981<span lang=\"EN-US\">5<\/span>\u79d2\u3002<\/p><p>\u3000\u3000C\u7a0b\u5e8f\u76f8\u6bd4\u975e\u5e38\u6162\u7684\u53e6\u4e00\u4e2a\u539f\u56e0\uff0cPython\u662f\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4ee3\u7801\u6267\u884c\u65f6\u4f1a\u4e00\u884c\u4e00\u884c\u5730\u7ffb\u8bd1\u6210CPU\u80fd\u7406\u89e3\u7684\u673a\u5668\u7801\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u975e\u5e38\u8017\u65f6\u3002\u800cC\u7a0b\u5e8f\u662f\u8fd0\u884c\u524d\u76f4\u63a5\u7f16\u8bd1\u6210CPU\u80fd\u6267\u884c\u7684\u673a\u5668\u7801\uff0c\u6240\u4ee5\u8fd0\u884c\u65f6\u975e\u5e38\u5feb\u3002\u6240\u4ee5\uff0cC\u8bed\u8a00\u9002\u5408\u5f00\u53d1\u90a3\u4e9b\u8ffd\u6c42\u8fd0\u884c\u901f\u5ea6\u3001\u5145\u5206\u53d1\u6325\u786c\u4ef6\u6027\u80fd\u7684\u7a0b\u5e8f\u3002\u800cPython\u662f\u7528\u6765\u7f16\u5199\u5e94\u7528\u7a0b\u5e8f\u7684\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7da7cd6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7da7cd6\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c42ffe7\" data-id=\"c42ffe7\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6f4f81a elementor-widget elementor-widget-heading\" data-id=\"6f4f81a\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u57fa\u7840\u8bed\u6cd5<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0c92d94 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"0c92d94\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-30032ca elementor-widget elementor-widget-text-editor\" data-id=\"30032ca\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul><li>\u4fdd\u7559\u5b57\u7b26<\/li><\/ul><p>\u3000\u3000\u6240\u6709 Python \u7684\u5173\u952e\u5b57\u53ea\u5305\u542b\u5c0f\u5199\u5b57\u6bcd\u3002\u4e0b\u9762\u7684\u5217\u8868\u663e\u793a\u4e86\u5728Python\u4e2d\u7684\u4fdd\u7559\u5b57\u3002\u8fd9\u4e9b\u4fdd\u7559\u5b57\u4e0d\u80fd\u7528\u4f5c\u5e38\u6570\u6216\u53d8\u6570\uff0c\u6216\u4efb\u4f55\u5176\u4ed6\u6807\u8bc6\u7b26\u540d\u79f0\u3002<\/p><table><tbody><tr><td width=\"111\"><p>and<\/p><\/td><td width=\"111\"><p>del<\/p><\/td><td width=\"111\"><p>for<\/p><\/td><td width=\"111\"><p>is<\/p><\/td><td width=\"111\"><p>raise<\/p><\/td><\/tr><tr><td width=\"111\"><p>assert<\/p><\/td><td width=\"111\"><p>elif<\/p><\/td><td width=\"111\"><p>from<\/p><\/td><td width=\"111\"><p>lambda<\/p><\/td><td width=\"111\"><p>return<\/p><\/td><\/tr><tr><td width=\"111\"><p>break<\/p><\/td><td width=\"111\"><p>else<\/p><\/td><td width=\"111\"><p>global<\/p><\/td><td width=\"111\"><p>not<\/p><\/td><td width=\"111\"><p>try<\/p><\/td><\/tr><tr><td width=\"111\"><p>class<\/p><\/td><td width=\"111\"><p>except<\/p><\/td><td width=\"111\"><p>if<\/p><\/td><td width=\"111\"><p>or<\/p><\/td><td width=\"111\"><p>while<\/p><\/td><\/tr><tr><td width=\"111\"><p>continue<\/p><\/td><td width=\"111\"><p>exec<\/p><\/td><td width=\"111\"><p>import<\/p><\/td><td width=\"111\"><p>pass<\/p><\/td><td width=\"111\"><p>with<\/p><\/td><\/tr><tr><td width=\"111\"><p>def<\/p><\/td><td width=\"111\"><p>finally<\/p><\/td><td width=\"111\"><p>in<\/p><\/td><td width=\"111\"><p>print<\/p><\/td><td width=\"111\"><p>yield<\/p><\/td><\/tr><\/tbody><\/table><ul><li>\u6807\u8bc6\u7b26<\/li><\/ul><p>\u3000\u3000\u5728 Python \u91cc\uff0c\u6807\u8bc6\u7b26\u7531\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf\u7ec4\u6210\uff0c\u4e25\u683c\u533a\u5206\u5927\u5c0f\u5199\u3002\u6240\u6709\u6807\u8bc6\u7b26\u53ef\u4ee5\u5305\u62ec\u82f1\u6587\u3001\u6570\u5b57\u4ee5\u53ca\u4e0b\u5212\u7ebf(_)\uff0c\u4f46\u4e0d\u80fd\u4ee5\u6570\u5b57\u5f00\u5934\u3002<\/p><p>\u3000\u3000\u4ee5\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u6807\u8bc6\u7b26\u662f\u6709\u7279\u6b8a\u610f\u4e49\u7684\u3002\u4ee5\u5355\u4e0b\u5212\u7ebf\u5f00\u5934 _foo \u7684\u4ee3\u8868\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee\u7684\u7c7b\u5c5e\u6027\uff0c\u9700\u901a\u8fc7\u7c7b\u63d0\u4f9b\u7684\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\uff0c\u4e0d\u80fd\u7528 from xxx import * \u800c\u5bfc\u5165\u3002<\/p><p>\u4ee5\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684 __foo \u4ee3\u8868\u7c7b\u7684\u79c1\u6709\u6210\u5458\uff0c\u4ee5\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u548c\u7ed3\u5c3e\u7684 __foo__ \u4ee3\u8868 Python \u91cc\u7279\u6b8a\u65b9\u6cd5\u4e13\u7528\u7684\u6807\u8bc6\uff0c\u5982 __init__() \u4ee3\u8868\u7c7b\u7684\u6784\u9020\u51fd\u6570<\/p><ul><li>\u7f29\u8fdb<\/li><\/ul><p>\u3000\u3000Python \u7684\u4ee3\u7801\u5757\u4e0d\u4f7f\u7528\u5927\u62ec\u53f7 {} \u6765\u63a7\u5236\u7c7b\uff0c\u51fd\u6570\u4ee5\u53ca\u5176\u4ed6\u903b\u8f91\u5224\u65ad\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48Python\u5bf9\u7f29\u8fdb\u683c\u5f0f\u5982\u6b64\u4e25\u683c\u7684\u539f\u56e0\u3002Python \u6700\u5177\u7279\u8272\u7684\u5c31\u662f\u7528\u7f29\u8fdb\u6765\u5199\u6a21\u5757\uff0c\u540c\u4e00\u4ee3\u7801\u5757\u5185\u8bed\u53e5\u5fc5\u987b\u5305\u542b\u76f8\u540c\u7684\u7f29\u8fdb\u7a7a\u767d\u91cf\u3002<\/p><ul><li>\u884c<\/li><\/ul><p>\u3000\u3000Python\u4e2d\u4e00\u822c\u4ee5\u65b0\u884c\u4f5c\u4e3a\u4e0a\u4e00\u884c\u7684\u7ed3\u675f\u7b26\uff0c\u6240\u4ee5\u4e00\u4e2aPython\u4ee3\u7801\u4e2d\u6700\u540e\u5f80\u5f80\u4f1a\u7559\u4e0b\u4e00\u884c\u7a7a\u884c\u4f5c\u4e3a\u4e0a\u4e00\u884c\u7684\u7ed3\u675f\u7b26\u3002<\/p><p>\u4e00\u884c\u4e2d\u82e5\u8981\u663e\u793a\u591a\u884c\u8bed\u53e5\uff0c\u5219\u4f7f\u7528\u5206\u53f7\u300c;\u300d\u5206\u5f00\u3002<\/p><p>\u4e00\u6761\u8bed\u53e5\u82e5\u8981\u5206\u591a\u884c\u73b0\u5b9e\uff0c\u5219\u4f7f\u7528\u659c\u6760\u300c\\\u300d\u5c06\u4e00\u884c\u8bed\u53e5\u5212\u5206\u3002<\/p><p>\u3000\u3000\u65b9\u6cd5\u4e4b\u95f4\u4f7f\u7528\u7a7a\u884c\u5206\u9694\uff0c\u8868\u793a\u4e00\u6bb5\u65b0\u7684\u4ee3\u7801\u5f00\u59cb\uff0c\u7c7b\u4e0e\u65b9\u6cd5\u5165\u53e3\u4e4b\u95f4\u4e5f\u4f7f\u7528\u7a7a\u884c\u5206\u9694\u3002\u4f46\u7a7a\u884c\u4e0e\u7f29\u8fdb\u4e0d\u540c\uff0c\u4e0d\u63d2\u5165\u7a7a\u884cPython\u89e3\u91ca\u5668\u8fd0\u884c\u65f6\u4e5f\u4e0d\u4f1a\u51fa\u9519\uff0c\u4f46\u89c4\u8303\u5316\u4f7f\u7528\u7a7a\u884c\u53ef\u5927\u5927\u63d0\u9ad8\u7a0b\u5e8f\u7684\u53ef\u8bfb\u6027\uff0c\u65b9\u4fbf\u65e5\u540e\u7ef4\u62a4\u91cd\u6784\u3002\u529f\u80fd\u7c7b\u4f3c\u4e8e\u6ce8\u91ca\u3002<\/p><ul><li>\u6ce8\u91ca<\/li><\/ul><p>\u3000\u3000\u5355\u884c\u6ce8\u91ca\u4f7f\u7528\u4e95\u53f7\u300c#\u300d\u4f5c\u5f00\u5934\uff0c\u591a\u884c\u6ce8\u91ca\u4f7f\u7528\u4e09\u4e2a\u5355\u5f15\u53f7\u300c\u2019\u2019\u2019\u300d\u6216\u53cc\u5f15\u53f7\u300c\u201d\u201d\u201d\u300d\u5c06\u6ce8\u91ca\u5185\u5bb9\u62ec\u8d77\u6765\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f68d427 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f68d427\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-54f9aeb\" data-id=\"54f9aeb\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c1b410c elementor-widget elementor-widget-heading\" data-id=\"c1b410c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u6570\u636e\u7c7b\u578b<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d954da9 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"d954da9\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-21fd987 elementor-widget elementor-widget-text-editor\" data-id=\"21fd987\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>\u3000\u3000Python\u6709\u4e94\u4e2a\u6807\u51c6\u7684\u6570\u636e\u7c7b\u578b\uff1a<\/p><p>\u3000\u3000Numbers\uff08\u6570\u5b57\uff09\u3001String\uff08\u5b57\u7b26\u4e32\uff09\u3001List\uff08\u5217\u8868\uff09\u3001Tuple\uff08\u5143\u7ec4\uff09\u3001Dictionary\uff08\u5b57\u5178\uff09<\/p><ul><li>\u53d8\u91cf<\/li><\/ul><p>\u3000\u3000Python\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cf\u65f6\u4e0d\u9700\u8981\u660e\u786e\u58f0\u660e\u7c7b\u578b\uff0c\u5e76\u4e14\u5728\u540e\u7eed\u8d4b\u503c\u662f\u53ef\u4ee5\u968f\u65f6\u66f4\u6539\u8be5\u53d8\u91cf\u6307\u5411\u7684\u6570\u636e\u7c7b\u578b\u3002\u8fd9\u79cd\u53d8\u91cf\u672c\u8eab\u7c7b\u578b\u4e0d\u56fa\u5b9a\u7684\u8bed\u8a00\u79f0\u4e3a\u52a8\u6001\u8bed\u8a00\uff0c\u5bf9\u5e94\u7684\u662f\u9759\u6001\u8bed\u8a00\u3002\u9759\u6001\u8bed\u8a00\u5728\u5b9a\u4e49\u53d8\u91cf\u65f6\u5fc5\u987b\u6307\u5b9a\u53d8\u91cf\u7c7b\u578b\uff0c\u5982Java\u662f\u9759\u6001\u8bed\u8a00\u3002<\/p><p>\u3000\u3000\u6ce8\uff1aPython\u4e2d\u6ca1\u6709char\u7c7b\u578b\uff0c\u4e00\u4e2a\u5b57\u7b26\u4e5f\u662f\u5b57\u7b26\u4e32<\/p><ul><li>\u5e38\u91cf<\/li><\/ul><p>\u3000\u3000\u5c31\u662f\u6307\u4e0d\u80fd\u6539\u53d8\u7684\u53d8\u91cf\uff0c\u901a\u5e38\u4f7f\u7528\u5168\u90e8\u5927\u5199\u7684\u53d8\u91cf\u540d\u8868\u793a\u5e38\u91cf\uff0c\u5982PI = 3.14159265359\u3002<\/p><p>\u3000\u3000\u4f46\u4e8b\u5b9e\u4e0aPython\u5e76\u6ca1\u6709\u58f0\u660e\u5e38\u91cf\u7684\u65b9\u6cd5\uff0cPI\u4e5f\u53ef\u4ee5\u88ab\u6539\u53d8\u3002\u5168\u5927\u5199\u53d8\u91cf\u540d\u8868\u793a\u5e38\u91cf\u53ea\u662f\u4e00\u4e2a\u4e60\u60ef\u7528\u6cd5\u3002<\/p><ul><li>\u6574\u6570<\/li><\/ul><p>\u3000\u3000Python\u4e2d\u6574\u6570\u7684\u503c\u4e0d\u53d7\u4f4d\u6570\u9650\u5236\uff0c\u5185\u5b58\u6709\u591a\u5927\u6570\u5b57\u5c31\u80fd\u6709\u591a\u5927\u3002\u540c\u65f6\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u8fdb\u5236\u6765\u8868\u793a\u4e00\u4e2a\u6574\u6570\uff0c\u4e8c\u8fdb\u5236\u5f00\u5934\u4f7f\u7528\u300c0b\u300d\uff0c\u516b\u8fdb\u5236\u5f00\u5934\u300c0o\u300d\uff0c\u5341\u516d\u8fdb\u5236\u300c0x\u300d\uff1a<\/p><blockquote><p>print(&#8220;\u4e8c\u8fdb\u5236\uff1a&#8221;, 0b10)<\/p><p>print(&#8220;\u516b\u8fdb\u5236\uff1a&#8221;, 0o10)<\/p><p>print(&#8220;\u5341\u8fdb\u5236\uff1a&#8221;, 10)<\/p><p>print(&#8220;\u5341\u516d\u8fdb\u5236\uff1a&#8221;, 0x10)<\/p><\/blockquote><p>\u3000\u3000\u6b64\u5916\u4e3a\u4e86\u63d0\u9ad8\u5927\u6570\u5b57\u7684\u53ef\u8bfb\u6027\uff0c\u6570\u5b57\u4e2d\u53ef\u4ee5\u6dfb\u52a0\u4e0b\u5212\u7ebf\u300c _ \u300d\u6765\u8fdb\u884c\u5206\u9694\uff0c10000000\u548c1000_0000\u662f\u5b8c\u5168\u4e00\u6837\u7684\u3002<\/p><ul><li>\u6d6e\u70b9\u6570<\/li><\/ul><p>\u3000\u3000\u4e5f\u5c31\u662f\u5c0f\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u6570\u5b66\u5199\u6cd5\u3002\u91cd\u70b9\u662f\u9762\u5bf9\u975e\u5e38\u5927\u6216\u975e\u5e38\u5c0f\u7684\u6d6e\u70b9\u6570\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u79d1\u5b66\u8ba1\u6570\u6cd5\uff0c\u59821.23 x 10^9\u3002\u7a0b\u5e8f\u4e2d\u5c31\u662f\u7528e\u66ff\u4ee310\u5373\u53ef\uff0c\u59821.23 x 10^9\uff0c\u5728Python\u4e2d\u5199\u4f5c1.23e9\u3002<\/p><ul><li>\u5b57\u7b26\u4e32<\/li><\/ul><p>\u3000\u3000\u4f7f\u7528\u5355\u5f15\u53f7\u300c\u2019\u2026\u2026\u2019\u300d\u6216\u8005\u53cc\u5f15\u53f7\u300c\u201d\u2026\u2026\u201d\u300d\u62ec\u8d77\u6765\u7684\u6587\u672c\u4fbf\u662f\u5b57\u7b26\u4e32\u3002\u8f6c\u610f\u5b57\u7b26\u53cd\u659c\u6760\u300c\\\u300d\u7528\u4e8e\u6807\u8bc6\u9700\u8981\u8f6c\u610f\u7684\u5b57\u7b26\uff0c\u5982\u300c\\n\u300d\u8868\u793a\u6362\u884c\uff0c\u300c\\t\u300d\u8868\u793a\u5236\u8868\u7b26\u7b49\u3002<\/p><p>\u3000\u3000\u82e5\u67d0\u4e00\u6bb5\u5b57\u7b26\u4e32\u5305\u542b\u5927\u91cf\u9700\u8981\u8f6c\u610f\u7684\u5b57\u7b26\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u300cr\u2019\u2026\u2026\u2019\u300d\u6765\u8868\u793a\u5355\u5f15\u53f7\u5185\u90e8\u7684\u5b57\u7b26\u7a7f\u9ed8\u8ba4\u4e0d\u8f6c\u610f\u3002<\/p><p>\u3000\u3000\u82e5\u67d0\u4e00\u6bb5\u5b57\u7b26\u7a7f\u5305\u542b\u5927\u91cf\u6362\u884c\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4e09\u5f15\u53f7\u300c\u2019\u2019\u2019\u2026\u2026\u2019\u2019\u2019\u300d\u6765\u8868\u793a\u591a\u884c\u5185\u5bb9\uff0c\u4ea6\u53ef\u914d\u5408\u300cr\u300d\u4f7f\u7528\u3002<\/p><ul><li>\u5e03\u5c14<\/li><\/ul><p>\u3000\u3000\u4f7f\u7528\u5927\u5199\u5f00\u5934\u7684True\u548cFalse\u8868\u793a\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u8fdb\u884c\u4e0e\u6216\u975e\u8fd0\u7b97\uff0c\u8868\u793a\u4e3a\u300cand\u300d\u300cor\u300d\u300cnot\u300d\uff1a<\/p><blockquote><p>True and False # False<\/p><p>True or False # True<\/p><p>not True # False<\/p><\/blockquote>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a604f21 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a604f21\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d750b17\" data-id=\"d750b17\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ca08437 elementor-widget elementor-widget-heading\" data-id=\"ca08437\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u6570\u636e\u96c6<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4f6020a elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"4f6020a\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c9a49c9 elementor-widget elementor-widget-text-editor\" data-id=\"c9a49c9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul><li>\u5217\u8868list<\/li><\/ul><p>\u3000\u3000\u662f\u4e00\u4e2a\u6709\u5e8f\u53ef\u53d8\u7684\u96c6\u5408\uff0c\u53ef\u4ee5\u968f\u65f6\u589e\u5220\u5176\u4e2d\u7684\u5143\u7d20\u3002\u5e76\u4e14\u5176\u4e2d\u7684\u5143\u7d20\u7c7b\u578b\u53ef\u4ee5\u4e0d\u540c\u3002<\/p><p>\u3000\u3000Python\u5bf9\u4e8e\u6570\u636e\u96c6\u7684\u7d22\u5f15\u6709\u4e24\u79cd\u53d6\u503c\u987a\u5e8f\uff0c\u5de6\u5230\u53f3\u9ed8\u8ba4\u4ece0\u9012\u589e\uff0c\u53f3\u5230\u5de6\u9ed8\u8ba4\u4ece-1\u9012\u51cf\u3002\u8fd9\u6761\u89c4\u5f8b\u540c\u6837\u9002\u7528\u4e8estring\u7c7b\u578b\u3002<\/p><p>\u3000\u3000\u4f7f\u7528range()\u65b9\u6cd5\u914d\u5408list()\u65b9\u6cd5\u53ef\u4ee5\u65b9\u4fbf\u7684\u521b\u9020\u4e00\u4e2a\u6709\u89c4\u5f8b\u7684\u6574\u6570\u5217\u8868\uff0clist() \u51fd\u6570\u662f\u5bf9\u8c61\u8fed\u4ee3\u5668\uff0c\u53ef\u4ee5\u628arange()\u8fd4\u56de\u7684\u53ef\u8fed\u4ee3\u5bf9\u8c61\u8f6c\u4e3a\u4e00\u4e2a\u5217\u8868\uff0c\u8fd4\u56de\u7684\u53d8\u91cf\u7c7b\u578b\u4e3a\u5217\u8868\uff0c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p><blockquote><p>list(range(start, stop[, step]))<\/p><\/blockquote><p>\u3000\u3000\u6ce8\uff1arange()\u65b9\u6cd5\u8fd4\u56de\u7684\u5e76\u4e0d\u662f\u5217\u8868\uff0c\u800c\u662f\u4e00\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u5728for\u5faa\u73af\u4e2d\u3002<\/p><ul><li>\u5143\u7ec4tuple<\/li><\/ul><p>\u3000\u3000tuple\u7c7b\u4f3c\u4e8elist\uff0c\u4f46\u5b83\u4e00\u65e6\u521d\u59cb\u5316\u540e\u4fbf\u4e0d\u80fd\u66f4\u6539\uff0c\u91cc\u9762\u6240\u6709\u53d8\u91cf\u7684\u6307\u5411\u4e5f\u4e0d\u4f1a\u66f4\u6539\u3002<\/p><p>\u3000\u3000\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5f53\u5b9a\u4e49\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684tuple\u7684\u65f6\u5019\uff0c\u9700\u8981\u5728\u8be5\u5143\u7d20\u540e\u9762\u6dfb\u52a0\u4e00\u4e2a\u9017\u53f7\u300c,\u300d\uff0c\u907f\u514d\u6b67\u4e49\uff1a<\/p><blockquote><p><span lang=\"EN-US\">t = (1,)<\/span><\/p><\/blockquote>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-353d3d1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"353d3d1\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-405f1d0\" data-id=\"405f1d0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e4716d2 elementor-widget elementor-widget-heading\" data-id=\"e4716d2\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u5faa\u73af\u8fed\u4ee3<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7ef0b7b elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"7ef0b7b\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0e73d12 elementor-widget elementor-widget-text-editor\" data-id=\"0e73d12\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>\u3000\u3000Python\u7684\u5faa\u73af\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd\uff0c\u4e00\u79cd\u662f\u300cfor \u2026 in \u2026\u300d\u5faa\u73af\uff0cin\u540e\u9762\u8ddf\u7740\u7684\u53ef\u4ee5\u662f\u6240\u6709\u7684\u300c\u53ef\u8fed\u4ee3\u5bf9\u8c61\u300d\uff0c\u4f1a\u4f9d\u6b21\u628alist\u6216tuple\u4e2d\u7684\u5143\u7d20\u8fed\u4ee3\u51fa\u6765\uff0c\u4e5f\u53ef\u901a\u8fc7\u63a7\u5236\u88ab\u8fed\u4ee3\u5bf9\u8c61\u7684\u5143\u7d20\u4e2a\u6570\u6765\u63a7\u5236\u5faa\u73af\u6b21\u6570\uff0c\u5e38\u4f7f\u7528range()\u65b9\u6cd5\u5b9e\u73b0\u3002<\/p><p>\u3000\u3000\u53e6\u4e00\u79cd\u5219\u662f\u300cwhile\u300d\u5faa\u73af\uff0c\u4e24\u79cd\u5faa\u73af\u90fd\u53ef\u4ee5\u4f7f\u7528\u300cbreak\u300d\u6216\u8005\u300ccontinue\u300d\u8bed\u53e5\u8fdb\u884c\u63a7\u5236\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ee4126d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ee4126d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3b89b57\" data-id=\"3b89b57\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e58fa46 elementor-widget elementor-widget-heading\" data-id=\"e58fa46\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">dict\u4e0eset<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ab864ae elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"ab864ae\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-74c9807 elementor-widget elementor-widget-text-editor\" data-id=\"74c9807\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\"><span lang=\"EN-US\">\u3000\u3000dict<\/span>\u662f\u5185\u7f6e\u5b57\u5178\u7c7b\uff0c\u5168\u7a0b<span lang=\"EN-US\">dictionary<\/span>\uff0c\u4f7f\u7528\u952e\u503c\u5bf9\u65b9\u5f0f\u5b58\u50a8\uff0c\u7279\u70b9\u662f\u67e5\u627e\u901f\u5ea6\u5feb\uff0c\u5360\u7528\u7a7a\u95f4\u5927\u3002<span lang=\"EN-US\">dict<\/span>\u4e2d\uff0c\u6bcf\u4e2a<span lang=\"EN-US\">key<\/span>\u901a\u8fc7\u54c8\u5e0c\u7b97\u6cd5\u76f4\u63a5\u627e\u5230\u5bf9\u5e94<span lang=\"EN-US\">value<\/span>\u7684\u5185\u5b58\u5730\u5740\u53d6\u51fa\uff0c\u6240\u4ee5\u8bfb\u53d6\u901f\u5ea6\u6781\u5feb\uff0c\u4e14\u4e0d\u53d7<span lang=\"EN-US\">dict<\/span>\u5143\u7d20\u4e2a\u6570\u5f71\u54cd\uff0c\u4e5f\u8bf4\u660e\u4e86\u4e3a\u4ec0\u4e48<span lang=\"EN-US\">dict<\/span>\u4e2d\u4e0d\u80fd\u51fa\u73b0\u91cd\u590d\u7684<span lang=\"EN-US\">key<\/span>\u3002\u5b9a\u4e49\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p><blockquote><p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\"><span lang=\"EN-US\">d = {key1 : value1, key2 : value2 }<\/span><\/p><\/blockquote><p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\">\u3000\u3000\u6709\u51e0\u70b9\u9700\u8981\u6ce8\u610f\uff0c<span lang=\"EN-US\">dict<\/span>\u4e2d<span lang=\"EN-US\">key<\/span>\u7684\u5b58\u50a8\u987a\u5e8f\u4e0e<span lang=\"EN-US\">key<\/span>\u7684\u653e\u5165\u987a\u5e8f\u65e0\u5173\uff1b<span lang=\"EN-US\">key<\/span>\u5fc5\u987b\u662f\u300c\u4e0d\u53ef\u53d8\u5bf9\u8c61\u300d\uff1b\u82e5\u540c\u4e00\u4e2a<span lang=\"EN-US\">key<\/span>\u88ab\u8d4b\u503c\u591a\u6b21\uff0c\u5219\u4f1a\u8bb0\u4f4f\u6700\u540e\u4e00\u6b21\u88ab\u8d4b\u503c\u7684\u503c\u3002<\/p><p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\">\u3000\u3000\u4e0d\u53ef\u53d8\u5bf9\u8c61\uff1a<span lang=\"EN-US\">strings<\/span>\u3001<span lang=\"EN-US\">tuples<\/span>\u3001<span lang=\"EN-US\">numbers<\/span><\/p><p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\">\u3000\u3000\u53ef\u4fee\u6539\u5bf9\u8c61\uff1a<span lang=\"EN-US\">list<\/span>\u3001<span lang=\"EN-US\">dict<\/span><\/p><p class=\"MsoNormal\" style=\"text-indent: 0cm; mso-char-indent-count: 0;\"><span lang=\"EN-US\">\u3000\u3000set\u4e0edict\u7c7b\u4f3c\uff0c\u4f46\u4e0d\u5b58\u50a8value\uff0c\u53ef\u4ee5\u770b\u4f5c\u4e00\u4e2a\u65e0\u5e8f\u4e0d\u91cd\u590d\u7684\u96c6\u5408\u3002<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b7b1031 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b7b1031\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d128005\" data-id=\"d128005\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ceda5d5 elementor-widget elementor-widget-heading\" data-id=\"ceda5d5\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u51fd\u6570<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35d9985 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-1396 elementor-widget-divider\" data-id=\"35d9985\" data-element_type=\"widget\" data-settings=\"{&quot;_animation&quot;:&quot;none&quot;,&quot;_animation_delay&quot;:1000}\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ced70e6 elementor-widget elementor-widget-text-editor\" data-id=\"ced70e6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><span lang=\"EN-US\">\u3000\u3000<\/span>Python\u4e2d\uff0c\u6240\u6709\u5143\u7d20\u7686\u662f\u5bf9\u8c61\uff0c\u51fd\u6570\u4e5f\u4e0d\u4f8b\u5916\u3002\u4e0eJava\u4e0d\u540c\uff0cJava\u4e2d\u7684\u65b9\u6cd5\u6307\u7684\u662f\u5bf9\u8c61\u7684\u5177\u4f53\u884c\u4e3a\uff0c\u800cPython\u4e2d\u7684\u51fd\u6570\u662f\u53ef\u8c03\u7528\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528\u5185\u7f6e\u7684callable()\u51fd\u6570\u6765\u5224\u65ad\u5bf9\u8c61\u80fd\u5426\u88ab\u8c03\u7528\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728Python\u4e2d\u5b8c\u5168\u53ef\u4ee5\u628a\u534a\u6570\u540d\u79f0\u8d4b\u7ed9\u4e00\u4e2a\u53d8\u91cf\uff0c\u901a\u8fc7\u8fd9\u4e2a\u53d8\u91cf\u6765\u8c03\u7528\u51fd\u6570\uff0c\u76f8\u5f53\u4e8e\u7ed9\u4e00\u4e2a\u51fd\u6570\u8d77\u4e86\u4e00\u4e2a\u522b\u540d\u3002<\/p><ul><li>\u5b9a\u4e49<\/li><\/ul><p><span lang=\"EN-US\">\u3000\u3000<\/span>Pyhotn\u4e2d\u5b9a\u4e49\u51fd\u6570\u9700\u8981\u4f7f\u7528\u300cdef\u300d\u5173\u952e\u5b57\u5f00\u5934\uff0c\u540e\u63a5\u51fd\u6570\u540d\uff0c\u5c0f\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u53c2\u6570\u3001\u5192\u53f7\uff0c\u7136\u540e\u518d\u7f29\u8fdb\u5185\u7f16\u5199\u51fd\u6570\u4f53\u3002\u4e0d\u9700\u8981\u5b9a\u4e49\u51fd\u6570\u8fd4\u56de\u503c\u3002\u51fd\u6570\u4f53\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u82e5\u60f3\u8981\u5b9a\u4e49\u4e00\u4e2a\u4ec0\u4e48\u90fd\u4e0d\u505a\u7684\u51fd\u6570\uff0c\u9700\u8981\u4f7f\u7528\u300cpass\u300d\u5173\u952e\u5b57\u4f5c\u4e3a\u51fd\u6570\u4f53\u7684\u5360\u4f4d\u7b26\u3002<\/p><p>Python\u7684\u51fd\u6570\u5141\u8bb8\u8fd4\u56de\u591a\u4e2a\u503c\uff0c\u300creturn\u300d\u5173\u952e\u5b57\u540e\u7684\u8fd4\u56de\u503c\u4f7f\u7528\u9017\u53f7\u300c,\u300d\u9694\u5f00\u5373\u53ef\u3002\u672c\u8d28\u4e0a\u8fd4\u56de\u7684\u591a\u4e2a\u503c\u662f\u4e00\u4e2a\u300ctuple\u300d\u3002<\/p><ul><li>\u53c2\u6570<\/li><\/ul><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u51fd\u6570\u5b9a\u4e49\u65f6\uff0c\u53c2\u6570\u7684\u987a\u5e8f\u5fc5\u987b\u662f\uff1a<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u5fc5\u9009\u53c2\u6570\u3001\u9ed8\u8ba4\u53c2\u6570\u3001\u53ef\u53d8\u53c2\u6570\u3001\u547d\u540d\u5173\u952e\u5b57\u53c2\u6570\u3001\u5173\u952e\u5b57\u53c2\u6570<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u5fc5\u9009\u53c2\u6570\uff1a\u8c03\u7528\u51fd\u6570\u65f6\uff0c\u5fc5\u987b\u4f20\u5165\u6570\u91cf\u4e0e\u7c7b\u578b\u5408\u6cd5\u7684\u53c2\u6570<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u9ed8\u8ba4\u53c2\u6570\uff1a\u82e5\u8c03\u7528\u51fd\u6570\u65f6\u6ca1\u6709\u4f20\u5165\u53c2\u6570\uff0c\u5219\u51fd\u6570\u8fd0\u884c\u65f6\u8be5\u53c2\u6570\u8ba4\u4e3a\u58f0\u660e\u65f6\u5b9a\u4e49\u7684\u9ed8\u8ba4\u503c\u3002<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u53ef\u53d8\u53c2\u6570\uff1a\u4f20\u5165\u7684\u53c2\u6570\u6570\u91cf\u53ef\u53d8\uff0c\u51fd\u6570\u5185\u90e8\u5904\u7406\u65f6\uff0c\u53ef\u53d8\u53c2\u6570\u88ab\u770b\u4f5c\u4e00\u4e2a\u300ctuple\u300d\u3002<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u5173\u952e\u5b57\u53c2\u6570\uff1a\u7c7b\u4f3c\u4e8e\u53ef\u53d8\u53c2\u6570\uff0c\u4f46\u51fd\u6570\u5185\u90e8\u5904\u7406\u65f6\u88ab\u770b\u4f5c\u4e00\u4e2a\u300cdict\u300d\uff0c\u6240\u4ee5\u4f20\u5165\u53c2\u6570\u662f\u662f\u6309\u7167key-value\u7684\u952e\u503c\u5bf9\u5f62\u5f0f\u4f20\u5165\u3002<\/p><p><span lang=\"EN-US\">\u3000\u3000<\/span>\u547d\u540d\u5173\u952e\u5b57\u53c2\u6570\uff1a\u7c7b\u4f3c\u4e8e\u5173\u952e\u5b57\u53c2\u6570\uff0c\u4f46\u662f\u53ea\u63a5\u53d7\u6307\u5b9a\u5173\u952e\u5b57\u7684\u53c2\u6570\u3002\u82e5\u51fd\u6570\u58f0\u660e\u65f6\u5df2\u6709\u4e00\u4e2a\u53ef\u53d8\u53c2\u6570\uff0c\u540e\u9762\u8ddf\u7740\u7684\u547d\u540d\u5173\u952e\u5b57\u53c2\u6570\u5c31\u4e0d\u518d\u9700\u8981\u4e00\u4e2a\u7279\u6b8a\u5206\u9694\u7b26\u300c*\u300d\u4e86\u3002<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Python\u57fa\u7840\u8bed\u6cd5 \u524d\u8a00 \u3000\u3000\u8fd9\u9635\u5b50\u62a5\u540d\u4e86\u5b66\u6821\u4e00\u4e2a\u6bd4\u8d5b\uff0c\u662f\u6570\u636e\u7edf\u8ba1\u76f8\u5173\u7684\uff0c\u91cc\u9762\u9700\u8981\u5b66\u4e60\u5230Python\u722c\u866b\u76f8\u5173 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.xinot.icu\/?p=1570\"> <span class=\"screen-reader-text\">Python\u57fa\u7840\u8bed\u6cd5<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1589,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-1570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-24"],"_links":{"self":[{"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/posts\/1570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1570"}],"version-history":[{"count":20,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/posts\/1570\/revisions"}],"predecessor-version":[{"id":1596,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/posts\/1570\/revisions\/1596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=\/wp\/v2\/media\/1589"}],"wp:attachment":[{"href":"https:\/\/www.xinot.icu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xinot.icu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}