{"id":191,"date":"2023-02-22T22:07:40","date_gmt":"2023-02-22T14:07:40","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=191"},"modified":"2023-02-22T22:07:51","modified_gmt":"2023-02-22T14:07:51","slug":"python-case-conversion","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/22\/python-case-conversion\/","title":{"rendered":"Python\u5927\u5c0f\u5199\u8f6c\u6362"},"content":{"rendered":"<h2>\u5927\u5199<\/h2>\n<p>\u628a\u6240\u6709\u5b57\u7b26\u4e2d\u7684\u5c0f\u5199\u5b57\u6bcd\u8f6c\u6362\u6210\u5927\u5199\u5b57\u6bcd<\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-python\">>&gt;&gt; str = &quot;hELLO wOrld!&quot;\n>&gt;&gt; print (str.upper())\nHELLO WORLD!<\/code><\/pre>\n<h2>\u5c0f\u5199<\/h2>\n<p>\u628a\u6240\u6709\u5b57\u7b26\u4e2d\u7684\u5927\u5199\u5b57\u6bcd\u8f6c\u6362\u6210\u5c0f\u5199\u5b57\u6bcd<\/p>\n<pre><code class=\"language-python\">>&gt;&gt; str = &quot;hELLO wOrld!&quot;\n>&gt;&gt; print (str.lower())\nhello world!<\/code><\/pre>\n<h2>\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u4e3a\u5927\u5199<\/h2>\n<p>\u628a\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u5316\u4e3a\u5927\u5199\u5b57\u6bcd\uff0c\u5176\u4f59\u5c0f\u5199<\/p>\n<pre><code class=\"language-python\">>&gt;&gt; str = &quot;hELLO wOrld!&quot;\n>&gt;&gt; print (str.capitalize())\nHello world!<\/code><\/pre>\n<h2>\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u5927\u5199<\/h2>\n<p>\u628a\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u5316\u4e3a\u5927\u5199\uff0c\u5176\u4f59\u5c0f\u5199<\/p>\n<pre><code class=\"language-python\">>&gt;&gt; str = &quot;hELLO wOrld!&quot;\n>&gt;&gt; print (str.title())\nHello World!<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5199 \u628a\u6240\u6709\u5b57\u7b26\u4e2d\u7684\u5c0f\u5199\u5b57\u6bcd\u8f6c\u6362\u6210\u5927\u5199\u5b57\u6bcd >&gt;&gt; str = &quot;hELLO wOrld [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}