{"id":269,"date":"2025-10-10T11:14:13","date_gmt":"2025-10-10T03:14:13","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=269"},"modified":"2025-10-10T11:14:14","modified_gmt":"2025-10-10T03:14:14","slug":"%e7%a4%ba%e4%be%8b%ef%bc%9a%e6%89%93%e5%8d%b010%e4%bb%a5%e5%86%85%e7%9a%84%e5%a5%87%e6%95%b0-8-4","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/10\/10\/%e7%a4%ba%e4%be%8b%ef%bc%9a%e6%89%93%e5%8d%b010%e4%bb%a5%e5%86%85%e7%9a%84%e5%a5%87%e6%95%b0-8-4\/","title":{"rendered":"\u793a\u4f8b\uff1a\u6253\u537010\u4ee5\u5185\u7684\u5947\u6570 8.4"},"content":{"rendered":"\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:clamp(18px, 1.125rem, 27px);font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#90A4AE;--cbp-line-number-width:calc(1 * 0.6 * 1.125rem);line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#ededed;color:#8198a3\">Python<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#90A4AE;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>num = 0\nwhile num &lt; 10:\n    num = num + 1\n    if num % 2 == 0:  # \u5982\u679c\u662f\u5076\u6570\n        continue       # \u8df3\u8fc7\u4e0b\u9762\u7684print\uff0c\u76f4\u63a5\u5f00\u59cb\u4e0b\u4e00\u8f6e\n    print(num)         # \u53ea\u6709\u5947\u6570\u624d\u4f1a\u6267\u884c\u5230\u8fd9\u91cc\n# \u8f93\u51fa\uff1a1 3 5 7 9<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-lighter\" style=\"background-color: #FAFAFA\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #90A4AE\">num <\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #39ADB5; font-style: italic\">while<\/span><span style=\"color: #90A4AE\"> num <\/span><span style=\"color: #39ADB5\">&lt;<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">10<\/span><span style=\"color: #39ADB5\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    num <\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #90A4AE\"> num <\/span><span style=\"color: #39ADB5\">+<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #39ADB5; font-style: italic\">if<\/span><span style=\"color: #90A4AE\"> num <\/span><span style=\"color: #39ADB5\">%<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">2<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">==<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">0<\/span><span style=\"color: #39ADB5\">:<\/span><span style=\"color: #90A4AE\">  <\/span><span style=\"color: #90A4AE; font-style: italic\"># \u5982\u679c\u662f\u5076\u6570<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">        <\/span><span style=\"color: #39ADB5; font-style: italic\">continue<\/span><span style=\"color: #90A4AE\">       <\/span><span style=\"color: #90A4AE; font-style: italic\"># \u8df3\u8fc7\u4e0b\u9762\u7684print\uff0c\u76f4\u63a5\u5f00\u59cb\u4e0b\u4e00\u8f6e<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">    <\/span><span style=\"color: #6182B8\">print<\/span><span style=\"color: #39ADB5\">(<\/span><span style=\"color: #6182B8\">num<\/span><span style=\"color: #39ADB5\">)<\/span><span style=\"color: #90A4AE\">         <\/span><span style=\"color: #90A4AE; font-style: italic\"># \u53ea\u6709\u5947\u6570\u624d\u4f1a\u6267\u884c\u5230\u8fd9\u91cc<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE; font-style: italic\"># \u8f93\u51fa\uff1a1 3 5 7 9<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":96,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,5],"tags":[],"class_list":["post-269","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-while","category-5"],"views":142,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":1,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":270,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/269\/revisions\/270"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/96"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}