{"id":142,"date":"2016-01-14T09:38:24","date_gmt":"2016-01-14T09:38:24","guid":{"rendered":"http:\/\/yellingstone.info\/?p=142"},"modified":"2016-04-13T00:19:15","modified_gmt":"2016-04-12T22:19:15","slug":"%e6%a0%b8%e5%bf%83%e8%af%ad%e8%a8%80%e5%ad%a6%e6%97%a0%e7%bc%96%e7%a8%8b%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8python%ef%bc%88%e7%ac%ac%e4%ba%94%e7%ab%a0%ef%bc%89","status":"publish","type":"post","link":"http:\/\/yellingstone.info\/?p=142","title":{"rendered":"\u6838\u5fc3\u8bed\u8a00\u5b66\u65e0\u7f16\u7a0b\u57fa\u7840\u5165\u95e8Python\uff08\u7b2c\u4e94\u7ae0\uff09"},"content":{"rendered":"<p>\u5efa\u8bae\u5148\u770b\u5b8c\u524d\u9762\u7684\u7ae0\u8282\uff0c\u524d\u9762\u7ae0\u8282\u5185\u5bb9\uff1a<!--more--><\/p>\n<ol>\n<li><a href=\"http:\/\/yellingstone.info\/?p=64\">\u548cPython\u597d\u597d\u8c08\u4e00\u8c08\uff08print\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=64\">Python\u4f60\u5e2e\u6211\u7701\u7701\u5fc3\u554a\uff08=\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=128\">\u628a\u6587\u5b57\u626d\u4e00\u626d\uff08\u5173\u4e8estring\u7684\u547d\u4ee4\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=128\">\u8ba9\u522b\u4eba\u4e5f\u6765\u53c2\u4e0e\u4e00\u4e0b\uff08raw_input\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=131\">\u6211\u771f\u5f97\u4e0d\u60f3\u770b\u5927\u6bb5\u7684\u5b57\u4e32\u554a\uff01\uff08list\u7684\u6982\u5ff5\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=135\">\u539f\u6765\u90fd\u662f\u70e4\u4e32\u513f\u800c\u5df2\uff08slicing\/indexing\uff09<\/a><\/li>\n<li><a href=\"http:\/\/yellingstone.info\/?p=135\">\u4e32\u513f\u4e0a\u7684\u8089\u8981\u4e00\u5757\u4e00\u5757\u5730\u5403\uff08for &#8230; in &#8230;\uff09<\/a><\/li>\n<\/ol>\n<hr>\n<p>8 \u6211\u5c31\u95ee\u4e00\u6b21\uff0c\u5982\u679c\u2026\uff08if\uff09<\/p>\n<p>\u4ece\u8fd9\u7ae0\u5f00\u59cb\uff0c\u53d9\u4e8b\u4f1a\u53d8\u5f97\u975e\u5e38\u4f8b\u884c\u516c\u4e8b\u3002\u56e0\u4e3a\u8bfb\u5230\u8fd9\u91cc\u7684\u4eba\uff0c\u6982\u5ff5\u5df2\u7ecf\u6709\u4e00\u4e9b\u4e86\uff0c\u6700\u591a\u53ea\u662f\u8bf4\u8bf4\u529f\u80fd\u3002<\/p>\n<p>\u4e4b\u524d\u8bf4\u5230for &#8230; in &#8230;\u6307\u7684\u662f\u628a\u4e00\u4e2a\u300c\u4e32\u300d\u4ece\u5934\u8bfb\u5230\u5c3e\u3002\u53ef\u662f\u8fd9\u79cd\u547d\u4ee4\u7f3a\u5c11\u4e00\u4e2a\u3010\u5728\u8bfb\u7684\u8fc7\u7a0b\u4e2d\u8fdb\u884c\u9009\u62e9\u7684\u80fd\u529b\u3011\u3002\u6bd4\u5982\u5728\u4e4b\u524d\u7684\u5b9e\u6218\u7ec3\u4e60\u91cc\uff0c\u8981\u8ba1\u7b97\u7279\u5b9a\u5143\u97f3\u5728\u6bcf\u4e00\u4e2a\u5355\u8bcd\u91cc\u51fa\u73b0\u7684\u6b21\u6570\uff08\u811a\u672c1\uff09\u3002<\/p>\n<p>[code language=&#8221;python&#8221;]<br \/>\n#\u811a\u672c1<br \/>\n#\u8f93\u5165\u6587\u672c\uff0c\u7a0d\u5fae\u6574\u7406\u4e00\u4e0b#<br \/>\ntext=&quot;Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability.&quot;<br \/>\ntext_cl=text.lower().replace(&#8216;,&#8217;,&#8221;).replace(&#8216;.&#8217;,&#8221;)<br \/>\nwords=text_cl.split()<br \/>\n#\u95ee\u4e0b\u7528\u6237\u60f3\u67e5\u54ea\u4e2a\u5143\u97f3#<br \/>\nprint &#8216;You are reading the following text:\\n&#8217;<br \/>\nprint text+&#8217;\\n&#8217;<br \/>\nvowel=raw_input(&#8216;Which vowel is in your mind? &#8216;)<br \/>\n#\u6309\u987a\u5e8f\u8bfb\u4e00\u4e2a\uff0c\u627e\u4e00\u4e2a\uff0cprint\u4e00\u4e2a#<br \/>\nfor word in words:<br \/>\n\trst=str(word.count(vowel))<br \/>\n\tprint word+&#8217;\\t&#8217;+rst<br \/>\n[\/code]<\/p>\n<p>\u811a\u672c1\u8fd0\u884c\u7684\u7ed3\u679c\u662f\uff1a\u5982\u679c\u8fd9\u4e2a\u5355\u8bcd\u4e0d\u5305\u542b\u8fd9\u4e2a\u5143\u97f3\uff0c\u663e\u793a0\uff1b\u5982\u679c\u8fd9\u4e2a\u5355\u8bcd\u5305\u542b\u8fd9\u4e2a\u5143\u97f3\uff0c\u5219\u663e\u793a\u6b64\u5143\u97f3\u5728\u8fd9\u4e2a\u5355\u8bcd\u91cc\u51fa\u73b0\u8fc7\u51e0\u6b21\u3002\u8fd9\u4e2a\u811a\u672c\u6709\u4e00\u4e2a\u5f88\u660e\u663e\u7684\u7f3a\u70b9\uff0c\u90a3\u5c31\u662f\u3010\u4e0d\u7ba1\u5305\u4e0d\u5305\u542b\u8fd9\u4e2a\u5143\u97f3\uff0c\u7ed3\u679c\u603b\u4f1a\u5360\u7528\u4e00\u884c\u3011\u3002\u6240\u4ee5\u5982\u679c\u6587\u672c\u7684\u957f\u5ea6\u518d\u5927\u4e9b\uff0c\u57fa\u672c\u4e00\u4e2a\u5c4f\u5e55\u5c31\u663e\u793a\u4e0d\u51fa\u6765\u4e86\u3002<\/p>\n<p>Python\u63d0\u4f9b\u7684\u89e3\u51b3\u65b9\u6848\u662f if \u7684\u6761\u4ef6\uff0c\u53e5\u6cd5\u662f\uff1a<\/p>\n<p>[code language=&#8221;python&#8221;]<br \/>\nif \u5982\u679c\u67d0\u4e2a\u6d4b\u8bd5\u6210\u529f\u4e86:<br \/>\n\t\u505a\u4e9b\u4ec0\u4e48<br \/>\n[\/code]<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u53ef\u9009\u7684else\u529f\u80fd\uff0c\u6307\u7684\u662f\u5982\u679c\u4e0d\u662f\u8fd9\u4e48\u56de\u4e8b\uff0c\u5219\u505a\u53e6\u5916\u4e00\u4ef6\u4e8b\u60c5\u3002\uff08else\u7684\u597d\u5904\u662f\u6761\u4ef6\u4e0d\u7528\u518d\u6253\u4e86\u2026\u53ea\u8981if\u4e0d\u6210\u7acb\u5c31\u884c\u4e86\uff09\uff0c\u6bd4\u5982\u811a\u672c2\uff1a<\/p>\n<p>[code language=&#8221;python&#8221;]<br \/>\n#\u811a\u672c2\uff1a<br \/>\na=int(raw_input(&quot;what is a? &quot;))<br \/>\nb=int(raw_input(&quot;what is b? &quot;))<br \/>\nif a&gt;b:<br \/>\n\tprint &quot;a is greater than b&quot;<br \/>\nelse:<br \/>\n\tprint &quot;a is not greater than b&quot;<br \/>\n[\/code]<\/p>\n<p>\u8fd9\u4e2a\u811a\u672c\u8ba9\u7528\u6237\u8f93\u5165\u4e24\u4e2a\u6570\u5b57\uff0c\u6bd4\u8f83\u5b83\u4eec\u7684\u5927\u5c0f\uff08\u6ce8\u610f\u7528\u6237\u8f93\u5165\u7684\u4e1c\u897f\u4e00\u5f00\u59cb\u662f\u5b57\u4e32\uff0c\u8981\u8f6c\u6210\u6570\u5b57\u4e4b\u540e\u624d\u80fd\u6bd4\u8f83\u5927\u5c0f\uff09\u3002<\/p>\n<p>\u53e6\u5916\u8fd8\u6709\u4e00\u4e2a\u53ef\u9009\u7684elif\uff0c\u610f\u601d\u662f\u5982\u679c\u4e00\u5f00\u59cb\u7684if\u90a3\u91cc\u6d4b\u8bd5\u5931\u8d25\u4e86\uff0c\u53ef\u4ee5\u518d\u6d4b\u4e00\u4e0belif\u8fd9\u8fb9\uff08\u5982\u679c\u8fd8\u662f\u5931\u8d25\u4e86\uff0c\u624d\u53bbelse\u90a3\u91cc\u3002\u5f53\u7136\u4e86elif\u8fd9\u79cd\u300c\u5907\u80ce\u300d\u53ef\u4ee5\u6709\u5f88\u591a\u4e2a\u3002\uff09\u6bd4\u5982\u811a\u672c3\uff1a<\/p>\n<p>[code language=&#8221;python&#8221;]<br \/>\na=int(raw_input(&quot;what is a? &quot;))<br \/>\nb=int(raw_input(&quot;what is b? &quot;))<br \/>\nif a&gt;b:<br \/>\n\tprint &quot;a is greater than b&quot;<br \/>\nelif a==b:<br \/>\n\tprint &quot;a equals b&quot;<br \/>\nelse:<br \/>\n\tprint &quot;a is less than b&quot;<br \/>\n[\/code]<\/p>\n<p>\u4e0a\u9762\u7684\u811a\u672c\u770b\u4e0a\u53bb\u90fd\u8d85\u7b80\u5355\uff0c\u4f46\u5b9e\u9645\u4e0a\u6709\u70b9\u9ebb\u70e6\uff0c\u56e0\u4e3a\u6240\u8c13if\u3010\u6d4b\u8bd5\u6210\u529f\u3011\u6709\u5f88\u591a\u79cd\u60c5\u51b5\uff1a<\/p>\n<p>\u3010\u6570\u5b57\u3011\u53bb\u6bd4\u5927\u5c0f\u6210\u529f\u4e86\u662f\u4e00\u79cd\uff0c\u4f46\u9664\u4e86\u4e4b\u524d\u6709\u63d0\u5230\u7684\u5927\u4e8e\uff08>\uff09\uff0c\u5c0f\u4e8e\uff08<\uff09\uff0c\u7b49\u4e8e\uff08==\uff09\u4ee5\u5916\uff0c\u5176\u5b9e\u8fd8\u6709\u5176\u4ed6\u7684\u4e00\u4e9b\uff08\u6ce8\uff1a=\u7684\u529f\u80fd\u662f\u8d4b\u503c\uff0c\u4e0d\u662f\u6bd4\u5927\u5c0f\uff09\uff1a\n\n<code>x>=y<\/code>\t\t\tx\u5927\u4e8e\u6216\u7b49\u4e8ey<br \/>\n<code>x<=y<\/code>\t\t\tx\u5c0f\u4e8e\u7b49\u4e8ey<br \/>\n<code>x!=y<\/code>\t\t\tx\u4e0d\u7b49\u4e8ey<\/p>\n<p>\u4e24\u4e2a\u3010\u5b57\u4e32\u3011\u3001\u6216\u4e24\u4e2a\u3010\u5217\u8868\u3011\u662f\u4e0d\u662f\u76f8\u540c\u7684\uff0c\u6216\u8005\u67d0\u4e2a\u300c\u4e32\u300d\u91cc\u662f\u4e0d\u662f\u5305\u542b\u67d0\u4e2a\u5143\u7d20\uff0c\u90fd\u80fd\u62ff\u6765\u505a\u6d4b\u8bd5\uff1a<\/p>\n<p><code>x is y<\/code>\t\t\u5982\u679cx\u548cy\u662f\u76f8\u540c\u7684<br \/>\n<code>x is not y<\/code>\t\t\u5982\u679cx\u548cy\u662f\u4e0d\u540c\u7684<br \/>\n<code>x in y<\/code>\t\t\u5982\u679cx\u662fy\u4e2d\u7684\u4e00\u4e2a\u5143\u7d20<br \/>\n<code>x not in y<\/code>\t\t\u5982\u679cx\u4e0d\u662fy\u4e2d\u7684\u4e00\u4e2a\u5143\u7d20<\/p>\n<p>\u3010\u8fd8\u6709\u4e00\u79cd\u3011\u3001\u5e76\u4e14\u53ef\u80fd\u66f4\u5e38\u7528\u4e5f\u66f4\u65b9\u4fbf\uff0c\u662f\u3010\u76f4\u63a5\u53bb\u6d4b\u8bd5\u4e00\u4e2a\u53d8\u91cf\u3011\uff0c\u53ea\u8981\u8fd9\u4e2a\u53d8\u91cf\u4e0d\u662f\u7a7a\u5b57\u4e32''\u3001\u4e0d\u662f\u7a7a\u5217\u8868[]\uff0c\u4e0d\u662f\u6570\u5b570\uff0c\u4e0d\u662fNone\u4e0d\u662fFalse\u8fd9\u4e9b\u2026\u2026\u7b49\u7b49\u7b49\u7b49\u2026\u2026\u5c31\u7b97\u6d4b\u8bd5\u6210\u529f\u3002\u6bd4\u5982\u811a\u672c4\u91cc\u7684if\u6d4b\u8bd5\uff0c\u53ea\u8981\u7528\u6237\u8f93\u5165\u7684\u662f\u9664\u4e860\u4ee5\u5916\u7684\u4efb\u610f\u4e00\u4e2a\u6570\u5b57\uff0cPython\u8bfb\u5230\u8fd9\u4e00\u884c\u81ea\u52a8\u5c31\u6d4b\u8bd5\u6210\u529f\u3002<\/p>\n<p>[code language=\"python\"]<br \/>\n#\u811a\u672c4\uff1a<br \/>\na=float(raw_input(&quot;gimme a number: &quot;))<br \/>\nif a:<br \/>\n\tprint &quot;approved&quot;<br \/>\n[\/code]<\/p>\n<p>\u5bf9\u4e86\u6d4b\u8bd5\u7684\u65f6\u5019\u4e5f\u53ef\u4ee5\u52a0\u5165and, or, and not \u8fd9\u79cd\u7ec4\u5408\u3002<\/p>\n<hr>\n<p>9 \u4f60\u6162\u6162\u5403\u5427\uff0c\u53ea\u8981\u8fd8\u6709\u5269\u7684\uff08while\uff09<\/p>\n<p>if \u7684\u7279\u70b9\u662f\u3010\u53ea\u6d4b\u8bd5\u4e00\u6b21\uff0c\u6d4b\u8bd5\u6210\u529f\u4e4b\u540e\u5c31\u6267\u884c\u5b9a\u4e49\u597d\u7684\u4e8b\u60c5\u3011\uff0c\u6d4b\u8bd5\u4e0d\u6210\u529f\u5c31\u76f4\u63a5\u53bb\u4e0b\u4e00\u884c\uff08elif\u4e5f\u597d\uff0celse\u4e5f\u597d\uff09\u3002\u8fd9\u79cd\u5de5\u4f5c\u6a21\u5f0f\u7684\u7f3a\u70b9\u5728\u4e8e\u65e0\u8bba\u6d4b\u8bd5\u7684\u6761\u4ef6\u8ba2\u5f97\u591a\u4e48\u7cbe\u5de7\u3001\u8be6\u7ec6\uff0c\u53ef\u662f\u5b9a\u4e49\u597d\u7684\u4e8b\u60c5\u53ea\u4f1a\u88ab\u6267\u884c\u4e00\u6b21\u3002\u4efb\u52a1\u6253\u5b57\u6253\u4e86\u5f88\u4e45\u6700\u540e\u53ea\u88ab\u6267\u884c\u4e00\u6b21\u660e\u663e\u5f88\u4e0d\u5212\u7b97\uff0c\u4e8e\u662f\u5c31\u6709\u4e86while\u5faa\u73af\uff0c\u5b83\u505a\u7684\u4e8b\u60c5\u662f\u3010\u5982\u679c\u6d4b\u8bd5\u6210\u529f\uff0c\u5b8c\u6210\u5b9a\u4e49\u597d\u7684\u4e8b\u60c5\uff0c\u4e4b\u540e\u91cd\u65b0\u68c0\u9a8c\u91cd\u65b0\u5e72\u6d3b\u76f4\u5230\u68c0\u9a8c\u5931\u8d25\u4e3a\u6b62\u3011\u3002<\/p>\n<p>\u53e5\u6cd5\u4e0a\u6765\u8bf4\u548cif\u7684\u547d\u4ee4\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff08\u811a\u672c5\uff09\uff1a<\/p>\n<p>[code language=\"python\"]<br \/>\n#\u811a\u672c5\uff1a<br \/>\na=1<br \/>\nwhile a&lt;5:<br \/>\n\tprint &quot;a is &quot;+str(a)+&quot; and a is less than 5&quot;<br \/>\n[\/code]<\/p>\n<p>\u4e0d\u8fc7\u811a\u672c5\u8fd0\u884c\u8d77\u6765\u662f\u4e2a\u6b7b\u5faa\u73af\uff0cwhile\u4e5f\u662f\u6700\u5bb9\u6613\u51fa\u73b0\u6b7b\u5faa\u73af\u7684\u3002while\u5bb9\u6613\u51fa\u73b0\u6b7b\u5faa\u73af\u7684\u539f\u56e0\u5728\u4e8e\u3010\u5b9a\u4e49\u7684\u4e8b\u60c5\uff0c\u5fc5\u987b\u5728\u91cd\u590d\u82e5\u5e72\u6b21\u4e4b\u540e\uff0c\u53ef\u4ee5\u8ba9while\u672c\u8eab\u7684\u6d4b\u8bd5\u5931\u8d25\u3011\u3002\u5728\u811a\u672c5\u7684while\u5faa\u73af\u91cc\uff0cPython\u53ea\u4f5c\u4e86print\u8fd9\u4e00\u4ef6\u4e8b\u60c5\uff0c\u800c\u8fd9\u4ef6\u4e8b\u60c5\u5bf9\u4e8ewhile\u7684\u9a8c\u8bc1\u4e0d\u4f1a\u4ea7\u751f\u4efb\u4f55\u5f71\u54cd\u3002\u8fd9\u65f6\u9700\u8981\u8bb0\u4f4fCtrl+C\u662f\u6700\u597d\u7684\u670b\u53cb\uff0c\u53ef\u4ee5\u7528\u6765\u624b\u52a8\u4e2d\u65ad\u811a\u672c\u7684\u3002\u811a\u672c6\u5219\u662f\u53ef\u884c\u7684\u3002<\/p>\n<p>[code language=\"python\"]<br \/>\n#\u811a\u672c6<br \/>\na=1<br \/>\nwhile a&lt;5:<br \/>\n\tprint &quot;a is &quot;+str(a)+&quot; and a is less than 5&quot;<br \/>\n\ta=a+1<br \/>\n[\/code]<\/p>\n<p>while\u7ecf\u5e38\u88ab\u7528\u6765\u505a\u8ba1\u6570\u5668\uff0c\u8ba9\u7279\u5b9a\u7684\u547d\u4ee4\u88ab\u6267\u884c\u82e5\u5e72\u6b21\uff0c\u6bd4\u5982\u7b97\u4e00\u4e0b2\u7684\u6574\u6570\u6b21\u65b9\uff08\u811a\u672c7\uff09\uff0c\u53ea\u8981\u8ba1\u6570\u5668cnt\u7684\u6570\u5b57\u6ca1\u6709\u8fbe\u5230\u7528\u6237\u5e0c\u671b\u7684\u6b21\u6570\uff0cwhile\u5faa\u73af\u91cc\u7684\u8ba1\u7b97\u4e0d\u4f1a\u505c\u4e0b\u6765\u3002\uff08\u5bf9\u4e86\uff0ca=a+1\u53ef\u4ee5\u7b80\u5316\u4e3a a+=1\uff09<\/p>\n<p>[code language=\"python\"]<br \/>\n#\u811a\u672c7<br \/>\ncnt=1<br \/>\ntm=int(raw_input(&quot;2 to the power of ___? &quot;))<br \/>\nrst=2<br \/>\nwhile cnt&lt;tm:<br \/>\n\trst=rst*2<br \/>\n\tcnt+=1<br \/>\nprint rst<br \/>\n[\/code]<\/p>\n<p>\u5b9e\u6218\u4e2d\u5982\u679c\u540c\u65f6\u7528\u4e0awhile\u548cif\uff0c\u53ef\u4ee5\u505a\u5f88\u591a\u4e8b\u60c5\u3002\u3010\u6bd4\u5982\u6709\u4e00\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u53ef\u4ee5\u627e\u4e00\u4e0b\u8fd9\u7bc7\u6587\u7ae0\u91cc\u5143\u97f3\u51fa\u73b0\u8fc7\u4e94\u6b21\u6216\u4e94\u6b21\u4ee5\u4e0a\u7684\u8bcd\u3011\u3002<\/p>\n<p>[code language=\"python\"]<br \/>\n#\u811a\u672c8<br \/>\n#\u8f93\u5165\u6587\u672c\uff0c\u7a0d\u5fae\u6574\u7406\u4e00\u4e0b#<br \/>\ntext=&quot;Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library. Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller, Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, allowing the distribution of Python-based software for use on those environments without requiring the installation of a Python interpreter. CPython, the reference implementation of Python, is free and open-source software and has a community-based development model, as do nearly all of its alternative implementations. CPython is managed by the non-profit Python Software Foundation.&quot;<br \/>\ntext_cl=text.lower().replace(',','').replace('.','')<br \/>\nwords=text_cl.split()<br \/>\n#\u95ee\u7528\u6237\u54ea\u4e9b\u5b57\u6bcd\u53ef\u4ee5\u4ee3\u8868\u5143\u97f3#<br \/>\nprint 'You are reading the following text:\\n'<br \/>\nprint text+'\\n'<br \/>\nvowels=raw_input('Which letters do you consider as vowels?')<br \/>\nvList=[]<br \/>\nfor vowel in vowels:<br \/>\n\tif vowel.lower() not in vList:<br \/>\n\t\tvList.append(vowel.lower())<br \/>\n#\u6d4b\u8bd5words\u91cc\u6bcf\u4e00\u4e2a\u5355\u8bcd#<br \/>\nwfList=[]<br \/>\nwhile words:<br \/>\n\tword=words.pop(0)<br \/>\n\tvC=0<br \/>\n\tfor vowel in vList:<br \/>\n\t\tvC+=word.count(vowel)<br \/>\n\tif vC&gt;=5:<br \/>\n\t\twfList.append(word+&quot;\\t&quot;+str(vC))<br \/>\nfor p in wfList:<br \/>\n\tprint p<br \/>\n[\/code]<\/p>\n<p>\u4e0b\u4e00\u7ae0\u4f30\u8ba1\u662f\u6700\u540e\u4e00\u7ae0\u4e86\u3002<\/p>\n<hr>\n<p>\u5c0f\u6284\uff1aif\uff0celif\uff0celse\uff0cwhile<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5efa\u8bae\u5148\u770b\u5b8c\u524d\u9762\u7684\u7ae0\u8282\uff0c\u524d\u9762\u7ae0\u8282\u5185\u5bb9\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/yellingstone.info\/index.php?rest_route=\/wp\/v2\/posts\/142"}],"collection":[{"href":"http:\/\/yellingstone.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yellingstone.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yellingstone.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yellingstone.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":0,"href":"http:\/\/yellingstone.info\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"wp:attachment":[{"href":"http:\/\/yellingstone.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yellingstone.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yellingstone.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}