{"id":1119959,"date":"2025-01-08T18:49:55","date_gmt":"2025-01-08T10:49:55","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1119959.html"},"modified":"2025-01-08T18:50:07","modified_gmt":"2025-01-08T10:50:07","slug":"python%e5%a6%82%e4%bd%95%e6%8a%8a%e5%ad%97%e7%ac%a6%e8%bd%ac%e5%b0%8f%e5%86%99%e5%ad%97%e6%af%8d","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1119959.html","title":{"rendered":"python\u5982\u4f55\u628a\u5b57\u7b26\u8f6c\u5c0f\u5199\u5b57\u6bcd"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082824\/bb813433-759f-4eb8-a38d-94fec9cdaa30.webp\" alt=\"python\u5982\u4f55\u628a\u5b57\u7b26\u8f6c\u5c0f\u5199\u5b57\u6bcd\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u6700\u5e38\u89c1\u7684\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u65b9\u6cd5<code>lower()<\/code>\u3001<code>casefold()<\/code>\u3001\u4ee5\u53ca\u5217\u8868\u89e3\u6790\u548c\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u3002<\/strong> \u5176\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f<code>lower()<\/code>\uff0c\u5b83\u80fd\u591f\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5927\u5199\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u53ca\u5176\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528<code>lower()<\/code>\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Python\u7684\u5185\u7f6e\u65b9\u6cd5<code>lower()<\/code>\u662f\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5927\u5199\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u3002\u8be5\u65b9\u6cd5\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\uff0c\u5e76\u4e14\u64cd\u4f5c\u975e\u5e38\u7b80\u4fbf\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello World!&quot;<\/p>\n<p>lowercase_text = text.lower()<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u5b57\u7b26\u4e32<code>text<\/code>\u4e2d\u7684\u6240\u6709\u5927\u5199\u5b57\u6bcd&quot;H&quot;\u548c&quot;W&quot;\u90fd\u88ab\u8f6c\u6362\u4e3a\u4e86\u5c0f\u5199\u5b57\u6bcd&quot;h&quot;\u548c&quot;w&quot;\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>casefold()<\/code>\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>casefold()<\/code>\u65b9\u6cd5\u548c<code>lower()<\/code>\u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4f46\u5b83\u4e3b\u8981\u7528\u4e8e\u5904\u7406\u56fd\u9645\u5316\u6587\u672c\u3002<code>casefold()<\/code>\u65b9\u6cd5\u4e0d\u4ec5\u4f1a\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u5927\u5199\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff0c\u8fd8\u4f1a\u5904\u7406\u5176\u4ed6\u8bed\u8a00\u4e2d\u7684\u7279\u6b8a\u5927\u5c0f\u5199\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;HELLO WORLD!&quot;<\/p>\n<p>casefolded_text = text.casefold()<\/p>\n<p>print(casefolded_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>casefold()<\/code>\u65b9\u6cd5\u7279\u522b\u9002\u7528\u4e8e\u9700\u8981\u5904\u7406\u591a\u8bed\u8a00\u6587\u672c\u7684\u60c5\u51b5\uff0c\u5982\u5fb7\u8bed\u4e2d\u7684&quot;\u00df&quot;\u5b57\u7b26\uff0c\u5b83\u4f1a\u88ab\u8f6c\u6362\u6210&quot;ss&quot;\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5217\u8868\u89e3\u6790<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u5185\u7f6e\u65b9\u6cd5\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u89e3\u6790\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\u9010\u4e2a\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u3002\u8fd9\u79cd\u65b9\u6cd5\u867d\u7136\u4e0d\u5982\u5185\u7f6e\u65b9\u6cd5\u7b80\u4fbf\uff0c\u4f46\u6709\u65f6\u5728\u9700\u8981\u81ea\u5b9a\u4e49\u5904\u7406\u7684\u60c5\u51b5\u4e0b\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello World!&quot;<\/p>\n<p>lowercase_text = &#39;&#39;.join([char.lower() for char in text])<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u901a\u8fc7\u904d\u5386\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\uff0c\u5e76\u4f7f\u7528<code>lower()<\/code>\u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff0c\u6700\u540e\u5c06\u6240\u6709\u5c0f\u5199\u5b57\u6bcd\u62fc\u63a5\u6210\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f<\/h3>\n<\/p>\n<p><p>\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u4e0e\u5217\u8868\u89e3\u6790\u7c7b\u4f3c\uff0c\u4f46\u5b83\u5728\u5904\u7406\u5927\u6570\u636e\u65f6\u66f4\u4e3a\u9ad8\u6548\uff0c\u56e0\u4e3a\u5b83\u4e0d\u4f1a\u4e00\u6b21\u6027\u751f\u6210\u6574\u4e2a\u5217\u8868\uff0c\u800c\u662f\u9010\u4e2a\u751f\u6210\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello World!&quot;<\/p>\n<p>lowercase_text = &#39;&#39;.join(char.lower() for char in text)<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u5728\u5904\u7406\u5927\u578b\u5b57\u7b26\u4e32\u65f6\u80fd\u591f\u8282\u7701\u5185\u5b58\uff0c\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528<code>map()<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>map()<\/code>\u51fd\u6570\u662fPython\u5185\u7f6e\u7684\u9ad8\u9636\u51fd\u6570\u4e4b\u4e00\uff0c\u5b83\u80fd\u591f\u5c06\u4e00\u4e2a\u51fd\u6570\u5e94\u7528\u5230\u4e00\u4e2a\u5e8f\u5217\u7684\u6bcf\u4e2a\u5143\u7d20\u4e0a\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\u3002\u5728\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u65f6\uff0c\u53ef\u4ee5\u7ed3\u5408<code>str.lower<\/code>\u51fd\u6570\u4f7f\u7528<code>map()<\/code>\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello World!&quot;<\/p>\n<p>lowercase_text = &#39;&#39;.join(map(str.lower, text))<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u4e0e\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u7c7b\u4f3c\uff0c\u4f46\u5b83\u7684\u53ef\u8bfb\u6027\u548c\u7075\u6d3b\u6027\u8f83\u9ad8\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5c06\u591a\u4e2a\u51fd\u6570\u7ec4\u5408\u4f7f\u7528\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u5904\u7406\u7279\u5b9a\u573a\u666f<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u7279\u5b9a\u573a\u666f\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u6765\u5904\u7406\u5b57\u7b26\u4e32\u7684\u8f6c\u6362\u3002\u4f8b\u5982\uff0c\u53ea\u8f6c\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u67d0\u4e9b\u90e8\u5206\u6216\u6839\u636e\u7279\u5b9a\u89c4\u5219\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">def custom_lowercase(text):<\/p>\n<p>    result = []<\/p>\n<p>    for char in text:<\/p>\n<p>        if char.isupper():<\/p>\n<p>            result.append(char.lower())<\/p>\n<p>        else:<\/p>\n<p>            result.append(char)<\/p>\n<p>    return &#39;&#39;.join(result)<\/p>\n<p>text = &quot;Hello World!&quot;<\/p>\n<p>lowercase_text = custom_lowercase(text)<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u51fd\u6570<code>custom_lowercase<\/code>\u904d\u5386\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26\uff0c\u5982\u679c\u8be5\u5b57\u7b26\u662f\u5927\u5199\u5b57\u6bcd\uff0c\u5219\u5c06\u5176\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff0c\u5426\u5219\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u9700\u8981\u81ea\u5b9a\u4e49\u8f6c\u6362\u89c4\u5219\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u6bd4\u8f83\u4e0d\u540c\u65b9\u6cd5\u7684\u6027\u80fd<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u578b\u6570\u636e\u65f6\uff0c\u6027\u80fd\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u8003\u8651\u56e0\u7d20\u3002\u4e3a\u4e86\u6bd4\u8f83\u4e0d\u540c\u65b9\u6cd5\u7684\u6027\u80fd\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>timeit<\/code>\u6a21\u5757\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import timeit<\/p>\n<p>text = &quot;Hello World!&quot; * 1000<\/p>\n<h2><strong>\u6d4b\u8bd5lower()\u65b9\u6cd5<\/strong><\/h2>\n<p>print(timeit.timeit(lambda: text.lower(), number=1000))<\/p>\n<h2><strong>\u6d4b\u8bd5casefold()\u65b9\u6cd5<\/strong><\/h2>\n<p>print(timeit.timeit(lambda: text.casefold(), number=1000))<\/p>\n<h2><strong>\u6d4b\u8bd5\u5217\u8868\u89e3\u6790<\/strong><\/h2>\n<p>print(timeit.timeit(lambda: &#39;&#39;.join([char.lower() for char in text]), number=1000))<\/p>\n<h2><strong>\u6d4b\u8bd5\u751f\u6210\u5668\u8868\u8fbe\u5f0f<\/strong><\/h2>\n<p>print(timeit.timeit(lambda: &#39;&#39;.join(char.lower() for char in text), number=1000))<\/p>\n<h2><strong>\u6d4b\u8bd5map()\u51fd\u6570<\/strong><\/h2>\n<p>print(timeit.timeit(lambda: &#39;&#39;.join(map(str.lower, text)), number=1000))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u57fa\u51c6\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u6bd4\u8f83\u4e0d\u540c\u65b9\u6cd5\u7684\u6267\u884c\u65f6\u95f4\uff0c\u4ece\u800c\u9009\u62e9\u6700\u9002\u5408\u5b9e\u9645\u9700\u6c42\u7684\u65b9\u6cd5\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5185\u7f6e\u65b9\u6cd5<code>lower()<\/code>\u548c<code>casefold()<\/code>\u7684\u6027\u80fd\u8f83\u597d\uff0c\u800c\u5217\u8868\u89e3\u6790\u548c\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u5728\u5904\u7406\u81ea\u5b9a\u4e49\u9700\u6c42\u65f6\u66f4\u4e3a\u7075\u6d3b\u3002<\/p>\n<\/p>\n<p><h3>\u516b\u3001\u5904\u7406\u4e0d\u540c\u7f16\u7801\u7684\u6587\u672c<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u4e0d\u540c\u7f16\u7801\u7684\u6587\u672c\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u5148\u5c06\u6587\u672c\u8f6c\u6362\u4e3a\u7edf\u4e00\u7684\u7f16\u7801\u683c\u5f0f\uff0c\u518d\u8fdb\u884c\u5c0f\u5199\u5b57\u6bcd\u8f6c\u6362\u3002Python\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7f16\u7801\u5904\u7406\u529f\u80fd\uff0c\u80fd\u591f\u65b9\u4fbf\u5730\u8fdb\u884c\u7f16\u7801\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528\u793a\u4f8b\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello World!&quot;.encode(&#39;utf-8&#39;)<\/p>\n<p>decoded_text = text.decode(&#39;utf-8&#39;)<\/p>\n<p>lowercase_text = decoded_text.lower()<\/p>\n<p>print(lowercase_text)  # \u8f93\u51fa\uff1ahello world!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u9996\u5148\u5c06\u5b57\u7b26\u4e32<code>text<\/code>\u7f16\u7801\u4e3a<code>utf-8<\/code>\u683c\u5f0f\uff0c\u7136\u540e\u518d\u89e3\u7801\u4e3a\u5b57\u7b26\u4e32\uff0c\u5e76\u4f7f\u7528<code>lower()<\/code>\u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u5c06Python\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u3002<strong><code>lower()<\/code>\u65b9\u6cd5\u6700\u5e38\u7528\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\uff0c<code>casefold()<\/code>\u65b9\u6cd5\u9002\u7528\u4e8e\u56fd\u9645\u5316\u6587\u672c\u5904\u7406\uff0c\u5217\u8868\u89e3\u6790\u548c\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u9002\u7528\u4e8e\u81ea\u5b9a\u4e49\u9700\u6c42\uff0c<code>map()<\/code>\u51fd\u6570\u5728\u51fd\u6570\u7ec4\u5408\u4f7f\u7528\u65f6\u8f83\u4e3a\u7075\u6d3b\u3002<\/strong> \u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u80fd\u591f\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u6267\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b57\u7b26\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684\u5185\u7f6e\u65b9\u6cd5<code>lower()<\/code>\u6765\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b57\u7b26\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u3002\u53ea\u9700\u8c03\u7528\u6b64\u65b9\u6cd5\u5373\u53ef\u3002\u4f8b\u5982\uff0c<code>my_string.lower()<\/code>\u5c06\u8fd4\u56de\u6240\u6709\u5c0f\u5199\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p><strong>Python\u4e2d\u662f\u5426\u6709\u5176\u4ed6\u65b9\u6cd5\u53ef\u4ee5\u5c06\u5b57\u7b26\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\uff1f<\/strong><br \/>\u9664\u4e86\u4f7f\u7528<code>lower()<\/code>\u65b9\u6cd5\u5916\uff0cPython\u8fd8\u63d0\u4f9b\u4e86<code>casefold()<\/code>\u65b9\u6cd5\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4e3b\u8981\u76ee\u7684\u662f\u8fdb\u884c\u66f4\u5f3a\u7684\u5927\u5c0f\u5199\u8f6c\u6362\uff0c\u9002\u7528\u4e8e\u56fd\u9645\u5316\u7684\u573a\u666f\u3002<code>casefold()<\/code>\u5728\u5904\u7406\u67d0\u4e9b\u7279\u5b9a\u8bed\u8a00\u7684\u5b57\u7b26\u65f6\u8868\u73b0\u5f97\u66f4\u4e3a\u51c6\u786e\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528<code>lower()<\/code>\u65b9\u6cd5\u65f6\uff0c\u662f\u5426\u4f1a\u5f71\u54cd\u539f\u59cb\u5b57\u7b26\u4e32\uff1f<\/strong><br \/><code>lower()<\/code>\u65b9\u6cd5\u4f1a\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\uff0c\u539f\u59cb\u5b57\u7b26\u4e32\u4e0d\u4f1a\u88ab\u4fee\u6539\u3002Python\u4e2d\u7684\u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u56e0\u6b64\u6bcf\u6b21\u8fdb\u884c\u5b57\u7b26\u4e32\u64cd\u4f5c\u90fd\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u5bf9\u8c61\uff0c\u800c\u4e0d\u4f1a\u66f4\u6539\u539f\u6765\u7684\u5185\u5bb9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u6700\u5e38\u89c1\u7684\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u65b9\u6cd5lower()\u3001casefold [&hellip;]","protected":false},"author":3,"featured_media":1119977,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119959"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1119959"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119959\/revisions"}],"predecessor-version":[{"id":1119978,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119959\/revisions\/1119978"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1119977"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1119959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1119959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1119959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}