{"id":2372,"date":"2022-12-10T10:03:27","date_gmt":"2022-12-10T02:03:27","guid":{"rendered":"https:\/\/qaqaq.top\/?p=2372"},"modified":"2023-01-10T22:02:54","modified_gmt":"2023-01-10T14:02:54","slug":"python%e6%8e%a7%e5%88%b6%e5%8f%b0%e7%8c%9c%e6%95%b0%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=2372","title":{"rendered":"python \u63a7\u5236\u53f0 \u731c\u6570\u6e38\u620f"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>import random\n\nmin = 1\nmax = 100\nnumber = random.randint(min, max)\nprint(number)\n\ncount = 0\nwhile count &lt; 10:\n    guess = eval(input(\"Please enter a number between {} and {}:\".format(min, max)))\n\n    if guess &gt; max:\n        count = count + 1\n        continue\n    elif guess &lt; min:\n        count = count + 1\n        continue\n\n    if guess == number:\n        print(\"\u731c\u4e2d\u4e86\")\n        break\n    elif guess &gt; number:\n        print(\"\u731c\u5927\u4e86\")\n        max = guess - 1\n        count = count + 1\n        continue\n    elif guess &lt; number:\n        print(\"\u731c\u5c0f\u4e86\")\n        min = guess + 1\n        count = count + 1\n        continue\n\nif count == 10:\n    print(\"\u6e38\u620f\u5931\u8d25\")\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[65],"tags":[50],"class_list":["post-2372","post","type-post","status-publish","format-standard","hentry","category-python-code","tag-python"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2372"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2372"}],"version-history":[{"count":3,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2372\/revisions"}],"predecessor-version":[{"id":3533,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2372\/revisions\/3533"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}