{"id":495,"date":"2020-08-07T06:49:31","date_gmt":"2020-08-06T22:49:31","guid":{"rendered":"https:\/\/byy3.com\/?p=495"},"modified":"2021-01-09T10:10:27","modified_gmt":"2021-01-09T02:10:27","slug":"python%e7%8c%9c%e6%95%b0%e5%ad%97%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=495","title":{"rendered":"python\u731c\u6570\u5b57\u6e38\u620f"},"content":{"rendered":"<pre>#\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684python\u731c\u6570\u5b57\u6e38\u620f\uff0c\u7a0b\u5e8f\u7248\u672cpython3(3.8.5)\r\n#\u6ce8\u610f\u683c\u5f0f\u9519\u8bef\uff0c\u91cd\u65b0\u8c03\u6574\u7f29\u8fdb\r\nimport random\r\nif __name__ == '__main__':\r\n yourname = input (\"\u6b22\u8fce\u8fdb\u5165byy3.com,\u5b66\u4e60python\u5c0f\u7a0b\u5e8f\u5b9e\u4f8b\uff0c\u731c\u6570\u5b57\u6e38\u620f\uff01\u8bf7\u8f93\u5165\u4f60\u7684\u540d\u5b57\uff1f\\n\");\r\nprint (\"\u4f60\u597d\uff0c\"+yourname)\r\nprint (\"\u51c6\u5907\u597d\u4e86\u5417\uff1f\u6e38\u620f\u5373\u5c06\u5f00\u59cb\u4e86\")\r\nprint (\"\u6211\u5c06\u9009\u62e9\u4e00\u4e2a\u6570\u5b57\u57281\u523050\u4e4b\u95f4\uff0c\u4f60\u80fd\u731c\u5230\u5417\uff1f\")\r\nrandom_num = random.randint(1,50)\r\ntime = 0\r\nwhile time &lt; 5:\r\n num = int (input(\"\u8bf7\u8f93\u5165\u4f60\u7684\u6570\u5b57\uff1a\"))\r\n if num == random_num:\r\n break;\r\n elif num &lt; random_num:\r\n print (\"\u4f60\u731c\u7684\u6570\u5b57\u5c0f\u4e86\uff01\")\r\n else:\r\n print (\"\u4f60\u731c\u7684\u6570\u5b57\u6bd4\u6211\u7684\u5927\uff01\")\r\ntime = time +1\r\nif time &lt; 5:\r\n print (\"\u606d\u559c\u4f60\u8d62\u4e86^_^ \")\r\nelse:\r\n print (\"\u5931\u8d25\u4e86\uff0c\u53ef\u4ee5\u518d\u6765\u4e00\u6b21\u7684\u54e6\u2299o\u2299,\u6b63\u786e\u7b54\u6848\u662f\"+str(random_num))<code>\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684python\u731c\u6570\u5b57\u6e38\u620f\uff0c\u7a0b\u5e8f\u7248\u672cpython3(3.8.5) #\u6ce8\u610f\u683c\u5f0f\u9519\u8bef\uff0c\u91cd\u65b0\u8c03\u6574\u7f29\u8fdb i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[352],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-python","tag-python"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=495"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}