{"id":63742,"date":"2026-01-22T10:32:38","date_gmt":"2026-01-22T02:32:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/63742.html"},"modified":"2026-01-22T10:32:38","modified_gmt":"2026-01-22T02:32:38","slug":"python-%e6%8e%a8%e5%af%bc%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/63742.html","title":{"rendered":"Python \u63a8\u5bfc\u5f0f"},"content":{"rendered":"<p>Python \u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u72ec\u7279\u7684\u6570\u636e\u5904\u7406\u65b9\u5f0f&#xff0c;\u53ef\u4ee5\u4ece\u4e00\u4e2a\u6570\u636e\u5e8f\u5217\u6784\u5efa\u53e6\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e8f\u5217\u7684\u7ed3\u6784\u4f53\u3002\u9002\u7528\u4e8e\u751f\u6210\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u548c\u5143\u7ec4<\/p>\n<h4>\u5217\u8868\u63a8\u5bfc\u5f0f<\/h4>\n<p>names &#061; [&#039;Bob&#039;,&#039;Tom&#039;,&#039;alice&#039;,&#039;Jerry&#039;,&#039;Wendy&#039;,&#039;Smith&#039;]<br \/>\nnew_names&#061;[ k.title() if k.startswith(&#039;a&#039;) else k.upper() for k in names if len(k)&gt;3]<br \/>\nprint(new_names)<\/p>\n<p>\u8fc7\u6ee4\u6389\u957f\u5ea6\u5c0f\u4e8e\u6216\u7b49\u4e8e3\u7684\u5b57\u7b26\u4e32\u5217\u8868&#xff0c;\u7b26\u5408\u6761\u4ef6\u7684\u5b57\u7b26\u4e32\u5217\u8868\u4e2d\u5982\u679c\u662f\u4ee5a\u5f00\u5934&#xff0c;\u5c31\u53ea\u628a\u7b2c\u4e00\u4e2a\u5b57\u7b26\u8f6c\u6362\u6210\u5927\u5199&#xff0c;\u5982\u679c\u4e0d\u662f\u4ee5a\u5f00\u5934&#xff0c;\u90fd\u8f6c\u6362\u6210\u5927\u5199&#xff0c;\u7ed3\u679c\u5982\u4e0b<\/p>\n<p>[&#039;Alice&#039;, &#039;JERRY&#039;, &#039;WENDY&#039;, &#039;SMITH&#039;]<\/p>\n<h4>\u5b57\u5178\u63a8\u5bfc\u5f0f<\/h4>\n<p>listdemo &#061; [&#039;Google&#039;,&#039;Runoob&#039;, &#039;Taobao&#039;]<br \/>\nmydic&#061;{i:len(i) for i in listdemo}<br \/>\nprint(mydic)<\/p>\n<p>\u5c06\u5217\u8868\u4e2d\u5404\u5b57\u7b26\u4e32\u503c\u4e3a\u952e&#xff0c;\u5404\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u4e3a\u503c&#xff0c;\u7ec4\u6210\u952e\u503c\u5bf9&#xff0c;\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b<\/p>\n<p>{&#039;Google&#039;:\u00a06,\u00a0&#039;Runoob&#039;:\u00a06,\u00a0&#039;Taobao&#039;:\u00a06}<\/p>\n<h4>\u96c6\u5408\u63a8\u5bfc\u5f0f<\/h4>\n<p>a&#061;{x for x in &#039;kdjskkslaaakdkdibckdkdi&#039; if x not in &#039;abc&#039;}<br \/>\nprint(a)<\/p>\n<p>\u5224\u65ad\u4e0d\u662fabc\u7684\u5b57\u7b26&#xff0c;\u5e76\u8f93\u51fa&#xff0c;\u7ed3\u679c\u5982\u4e0b<\/p>\n<p>{&#039;k&#039;, &#039;l&#039;, &#039;j&#039;, &#039;i&#039;, &#039;d&#039;, &#039;s&#039;}<\/p>\n<p>\u96c6\u5408\u81ea\u52a8\u8fc7\u6ee4\u4e86\u91cd\u590d\u5b57\u7b26\u4e32<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python \u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u72ec\u7279\u7684\u6570\u636e\u5904\u7406\u65b9\u5f0f&#xff0c;\u53ef\u4ee5\u4ece\u4e00\u4e2a\u6570\u636e\u5e8f\u5217\u6784\u5efa\u53e6\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e8f\u5217\u7684\u7ed3\u6784\u4f53\u3002\u9002\u7528\u4e8e\u751f\u6210\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u548c\u5143\u7ec4\u5217\u8868\u63a8\u5bfc\u5f0fnames  [Bob,Tom,alice,Jerry,Wendy,Smith]<br \/>\nnew_names[ k.title() if k.startswith(a) else k.upper() for k in names if len(k)&gt;3]<br \/>\nprint(new_names)\u8fc7\u6ee4\u6389\u957f\u5ea6\u5c0f\u4e8e\u6216\u7b49\u4e8e3\u7684\u5b57\u7b26\u4e32\u5217\u8868&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81],"topic":[],"class_list":["post-63742","post","type-post","status-publish","format-standard","hentry","category-server","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/63742.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Python \u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u72ec\u7279\u7684\u6570\u636e\u5904\u7406\u65b9\u5f0f&#xff0c;\u53ef\u4ee5\u4ece\u4e00\u4e2a\u6570\u636e\u5e8f\u5217\u6784\u5efa\u53e6\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e8f\u5217\u7684\u7ed3\u6784\u4f53\u3002\u9002\u7528\u4e8e\u751f\u6210\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u548c\u5143\u7ec4\u5217\u8868\u63a8\u5bfc\u5f0fnames [Bob,Tom,alice,Jerry,Wendy,Smith] new_names[ k.title() if k.startswith(a) else k.upper() for k in names if len(k)&gt;3] print(new_names)\u8fc7\u6ee4\u6389\u957f\u5ea6\u5c0f\u4e8e\u6216\u7b49\u4e8e3\u7684\u5b57\u7b26\u4e32\u5217\u8868&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/63742.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-22T02:32:38+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/63742.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/63742.html\",\"name\":\"Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-22T02:32:38+00:00\",\"dateModified\":\"2026-01-22T02:32:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/63742.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/63742.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/63742.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u63a8\u5bfc\u5f0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/63742.html","og_locale":"zh_CN","og_type":"article","og_title":"Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Python \u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u72ec\u7279\u7684\u6570\u636e\u5904\u7406\u65b9\u5f0f&#xff0c;\u53ef\u4ee5\u4ece\u4e00\u4e2a\u6570\u636e\u5e8f\u5217\u6784\u5efa\u53e6\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e8f\u5217\u7684\u7ed3\u6784\u4f53\u3002\u9002\u7528\u4e8e\u751f\u6210\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u548c\u5143\u7ec4\u5217\u8868\u63a8\u5bfc\u5f0fnames [Bob,Tom,alice,Jerry,Wendy,Smith] new_names[ k.title() if k.startswith(a) else k.upper() for k in names if len(k)&gt;3] print(new_names)\u8fc7\u6ee4\u6389\u957f\u5ea6\u5c0f\u4e8e\u6216\u7b49\u4e8e3\u7684\u5b57\u7b26\u4e32\u5217\u8868&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/63742.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-22T02:32:38+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/63742.html","url":"https:\/\/www.wsisp.com\/helps\/63742.html","name":"Python \u63a8\u5bfc\u5f0f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-22T02:32:38+00:00","dateModified":"2026-01-22T02:32:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/63742.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/63742.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/63742.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Python \u63a8\u5bfc\u5f0f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/63742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=63742"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/63742\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=63742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=63742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=63742"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=63742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}