{"id":210,"date":"2025-10-10T09:53:55","date_gmt":"2025-10-10T01:53:55","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=210"},"modified":"2025-10-10T09:53:56","modified_gmt":"2025-10-10T01:53:56","slug":"%e5%88%a4%e6%96%ad%e4%b8%80%e4%b8%aa%e6%95%b0-x-%e6%98%af%e5%90%a6%e5%9c%a8%e5%8c%ba%e9%97%b4-10-20-%e5%86%85%ef%bc%88%e5%8d%b3-10-%e2%89%a4-x-%e2%89%a4-20%ef%bc%89-5-4","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/10\/10\/%e5%88%a4%e6%96%ad%e4%b8%80%e4%b8%aa%e6%95%b0-x-%e6%98%af%e5%90%a6%e5%9c%a8%e5%8c%ba%e9%97%b4-10-20-%e5%86%85%ef%bc%88%e5%8d%b3-10-%e2%89%a4-x-%e2%89%a4-20%ef%bc%89-5-4\/","title":{"rendered":"\u5224\u65ad\u4e00\u4e2a\u6570 x \u662f\u5426\u5728\u533a\u95f4 [10, 20] \u5185\uff08\u5373 10 \u2264 x \u2264 20\uff09 5.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># \u8303\u4f8b\uff1a\u5224\u65ad\u4e00\u4e2a\u6570\u662f\u5426\u572810\u523020\u4e4b\u95f4\uff08\u5305\u542b10\u548c20\uff09\nx = float(input(\"\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570\uff1a \"))\n\nif x >= 10 and x &lt;= 20:\n    print(f\"{x} \u572810\u523020\u7684\u533a\u95f4\u5185\u3002\")\nelse:\n    print(f\"{x} \u4e0d\u572810\u523020\u7684\u533a\u95f4\u5185\u3002\")<\/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; font-style: italic\"># \u8303\u4f8b\uff1a\u5224\u65ad\u4e00\u4e2a\u6570\u662f\u5426\u572810\u523020\u4e4b\u95f4\uff08\u5305\u542b10\u548c20\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #90A4AE\">x <\/span><span style=\"color: #39ADB5\">=<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #E2931D\">float<\/span><span style=\"color: #39ADB5\">(<\/span><span style=\"color: #6182B8\">input<\/span><span style=\"color: #39ADB5\">(<\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #91B859\">\u8bf7\u8f93\u5165\u4e00\u4e2a\u6570\uff1a <\/span><span style=\"color: #39ADB5\">&quot;<\/span><span style=\"color: #39ADB5\">))<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #39ADB5; font-style: italic\">if<\/span><span style=\"color: #90A4AE\"> x <\/span><span style=\"color: #39ADB5\">&gt;=<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">10<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #39ADB5\">and<\/span><span style=\"color: #90A4AE\"> x <\/span><span style=\"color: #39ADB5\">&lt;=<\/span><span style=\"color: #90A4AE\"> <\/span><span style=\"color: #F76D47\">20<\/span><span style=\"color: #39ADB5\">:<\/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: #9C3EDA\">f<\/span><span style=\"color: #91B859\">&quot;<\/span><span style=\"color: #F76D47\">{<\/span><span style=\"color: #6182B8\">x<\/span><span style=\"color: #F76D47\">}<\/span><span style=\"color: #91B859\"> \u572810\u523020\u7684\u533a\u95f4\u5185\u3002&quot;<\/span><span style=\"color: #39ADB5\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #39ADB5; font-style: italic\">else<\/span><span style=\"color: #39ADB5\">:<\/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: #9C3EDA\">f<\/span><span style=\"color: #91B859\">&quot;<\/span><span style=\"color: #F76D47\">{<\/span><span style=\"color: #6182B8\">x<\/span><span style=\"color: #F76D47\">}<\/span><span style=\"color: #91B859\"> \u4e0d\u572810\u523020\u7684\u533a\u95f4\u5185\u3002&quot;<\/span><span style=\"color: #39ADB5\">)<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":101,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-5"],"views":144,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/210","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=210"}],"version-history":[{"count":1,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":211,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/210\/revisions\/211"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/101"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}