{"id":7215,"date":"2022-08-15T12:39:29","date_gmt":"2022-08-15T04:39:29","guid":{"rendered":"https:\/\/egonlin.com\/?p=7215"},"modified":"2022-08-15T12:49:21","modified_gmt":"2022-08-15T04:49:21","slug":"%e7%bb%83%e4%b9%a0%e9%a2%98%e4%bd%9c%e4%b8%9a","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=7215","title":{"rendered":"\u7ec3\u4e60\u9898&#038;\u4f5c\u4e1a"},"content":{"rendered":"<h2>\u4e00\uff0c\u7ec3\u4e60\u9898<\/h2>\n<p>1, \u7b80\u8ff0\u7f16\u8bd1\u578b\u4e0e\u89e3\u91ca\u578b\u8bed\u8a00\u7684\u533a\u522b\uff0c\u4e14\u5206\u522b\u5217\u51fa\u4f60\u77e5\u9053\u7684\u54ea\u4e9b\u8bed\u8a00\u5c5e\u4e8e\u7f16\u8bd1\u578b\uff0c\u54ea\u4e9b\u5c5e\u4e8e\u89e3\u91ca\u578b<\/p>\n<p>2, \u6267\u884c Python \u811a\u672c\u7684\u4e24\u79cd\u65b9\u5f0f\u662f\u4ec0\u4e48<\/p>\n<p>3, Pyhton \u5355\u884c\u6ce8\u91ca\u548c\u591a\u884c\u6ce8\u91ca\u5206\u522b\u7528\u4ec0\u4e48?<\/p>\n<p>4, \u5e03\u5c14\u503c\u5206\u522b\u6709\u4ec0\u4e48?<\/p>\n<p>5, \u58f0\u660e\u53d8\u91cf\u6ce8\u610f\u4e8b\u9879\u6709\u90a3\u4e9b?<\/p>\n<p>6, \u5982\u4f55\u67e5\u770b\u53d8\u91cf\u5728\u5185\u5b58\u4e2d\u7684\u5730\u5740?<\/p>\n<p>7,\u5199\u4ee3\u7801<br \/>\n\u5b9e\u73b0\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801,\u5f53\u7528\u6237\u540d\u4e3a seven \u4e14 \u5bc6\u7801\u4e3a 123 \u65f6,\u663e\u793a\u767b\u9646\u6210\u529f,\u5426\u5219\u767b\u9646\u5931\u8d25!<br \/>\n\u5b9e\u73b0\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801,\u5f53\u7528\u6237\u540d\u4e3a seven \u4e14 \u5bc6\u7801\u4e3a 123 \u65f6,\u663e\u793a\u767b\u9646\u6210\u529f,\u5426\u5219\u767b\u9646\u5931\u8d25,\u5931\u8d25\u65f6\u5141\u8bb8\u91cd\u590d\u8f93\u5165\u4e09\u6b21<br \/>\n\u5b9e\u73b0\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801,\u5f53\u7528\u6237\u540d\u4e3a seven \u6216 alex \u4e14 \u5bc6\u7801\u4e3a 123 \u65f6,\u663e\u793a\u767b\u9646\u6210\u529f,\u5426\u5219\u767b\u9646\u5931\u8d25,\u5931\u8d25\u65f6\u5141\u8bb8\u91cd\u590d\u8f93\u5165\u4e09\u6b21<\/p>\n<p>8, \u5199\u4ee3\u7801<br \/>\na. \u4f7f\u7528while\u5faa\u73af\u5b9e\u73b0\u8f93\u51fa2-3+4-5+6&#8230;+100 \u7684\u548c<br \/>\nb. \u4f7f\u7528 while \u5faa\u73af\u5b9e\u73b0\u8f93\u51fa 1,2,3,4,5, 7,8,9, 11,12 \u4f7f\u7528 while \u5faa\u73af\u5b9e\u73b0\u8f93\u51fa 1-100 \u5185\u7684\u6240\u6709\u5947\u6570<br \/>\nc. \u4f7f\u7528 while \u5faa\u73af\u5b9e\u73b0\u8f93\u51fa 1-100 \u5185\u7684\u6240\u6709\u5076\u6570<\/p>\n<p>9, \u73b0\u6709\u5982\u4e0b\u4e24\u4e2a\u53d8\u91cf,\u8bf7\u7b80\u8ff0 n1 \u548c n2 \u662f\u4ec0\u4e48\u5173\u7cfb?<\/p>\n<pre><code>n1 = 123456\nn2 = n1<\/code><\/pre>\n<h2>\u4e8c\uff0c\u4f5c\u4e1a<\/h2>\n<p>\u57fa\u7840\u9700\u6c42\uff1a<\/p>\n<p>\u8ba9\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u5bc6\u7801<br \/>\n\u8ba4\u8bc1\u6210\u529f\u540e\u663e\u793a\u6b22\u8fce\u4fe1\u606f<br \/>\n\u8f93\u9519\u4e09\u6b21\u540e\u9000\u51fa\u7a0b\u5e8f<\/p>\n<pre><code>dic={\n    &#039;egon1&#039;:{&#039;password&#039;:&#039;123&#039;,&#039;count&#039;:0},\n    &#039;egon2&#039;:{&#039;password&#039;:&#039;123&#039;,&#039;count&#039;:0},\n    &#039;egon3&#039;:{&#039;password&#039;:&#039;123&#039;,&#039;count&#039;:0},\n\n}\n\nwhile True:\n    name=input(&#039;username&gt;&gt;: &#039;)\n\n    if not name in dic:\n        print(&#039;\u7528\u6237\u4e0d\u5b58\u5728&#039;)\n        continue\n    if dic[name][&#039;count&#039;] &gt; 2:\n        print(&#039;\u5c1d\u8bd5\u6b21\u6570\u8fc7\u591a,\u9501\u5b9a&#039;)\n        continue\n\n    password=input(&#039;password&gt;&gt;: &#039;)\n\n    if password == dic[name][&#039;password&#039;]:\n        print(&#039;\u767b\u5f55\u6210\u529f&#039;)\n        break\n    else:\n        print(&#039;\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef&#039;)\n        dic[name][&#039;count&#039;]+=1\n<\/code><\/pre>\n<p>\u5347\u7ea7\u9700\u6c42\uff1a<\/p>\n<p>\u53ef\u4ee5\u652f\u6301\u591a\u4e2a\u7528\u6237\u767b\u5f55 (\u63d0\u793a\uff0c\u901a\u8fc7\u5217\u8868\u5b58\u591a\u4e2a\u8d26\u6237\u4fe1\u606f)<br \/>\n\u7528\u62373\u6b21\u8ba4\u8bc1\u5931\u8d25\u540e\uff0c\u9000\u51fa\u7a0b\u5e8f\uff0c\u518d\u6b21\u542f\u52a8\u7a0b\u5e8f\u5c1d\u8bd5\u767b\u5f55\u65f6\uff0c\u8fd8\u662f\u9501\u5b9a\u72b6\u6001\uff08\u63d0\u793a:\u9700\u628a\u7528\u6237\u9501\u5b9a\u7684\u72b6\u6001\u5b58\u5230\u6587\u4ef6\u91cc\uff09<\/p>\n<div id=\"rml_readmorelogin_placeholder\" style=\"position:relative;\"><div id=\"rml_fade_content\" style=\"position: absolute;\r\ntop:-10em;\r\nwidth:100%;\r\nheight:10em;\r\nbackground: -webkit-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -moz-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -o-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\r\nbackground-image: -ms-linear-gradient(rgba(255, 255, 255, 0) 0%,#ffffff 100%);\"><\/div><div class=\"wpf-controller aru_rml_from_in_post\" style=\"background-color:#eeeeee;border:5px solid #cce6ff;\" id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><h2 id=\"Header\">\u67e5\u770b\u66f4\u591a<\/h2><div id=\"Message\"><p>\u8054\u7cfb\u7ba1\u7406\u5458\u5fae\u4fe1tutu19192010\uff0c\u6ce8\u518c\u8d26\u53f7<\/p>\n<\/div><div id=\"StatusBarHeader\"><\/div><form id=\"ARU_ReadMoreLogin_ReadMoreLoginController\"><input name=\"post_id\" value=\"7215\" type=\"hidden\"\/><input name=\"_init_callback\" value=\"InitLogin\" type=\"hidden\"\/><input name=\"post_id\" value=\"7215\" type=\"hidden\"\/><input name=\"rt_ype\" value=\"1\" type=\"hidden\"\/><input name=\"nonce\" value=\"4cfd933022\" type=\"hidden\"\/><input name=\"_wpnonce\" value=\"8a8c989f31\" type=\"hidden\"\/><input name=\"_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_proxy_controller\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginController\" type=\"hidden\"\/><input name=\"_view\" value=\"ARU_ReadMoreLogin\\ReadMoreLoginView\" type=\"hidden\"\/><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\" width=\"400px\"><table class=\"wpf-table-placeholder\"><tbody class=\"wpf-table-placeholder\"><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Username:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"username\" value=\"\" type=\"text\"\/><\/td><\/tr><tr class=\"wpf-table-placeholder\"><th class=\"wpf-table-placeholder-input\"><label class=\"wpf-label\">Password:<\/label><\/th><\/tr><tr class=\"wpf-table-placeholder\"><td class=\"wpf-table-placeholder-input\"><input class=\"regular-text text_input\" name=\"password\" value=\"\" type=\"password\"\/><\/td><\/tr><\/tbody><\/table><p class=\"wpf-table-placeholder submit\"><button class=\"wp_plugin_framework_ajax_button\" type=\"button\" style=\"background-color:#4D90FE;;color:#ffffff;;border:1px solid #3079ed;\" name=\"_event\" value=\"ButtonLogin\">Log in<\/button><\/p><\/td><td class=\"wpf-table-placeholder-input\"><\/td><\/tr><\/tbody><\/table><\/form><div id=\"ButtonStartRegister\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=register\">Register<\/a><\/div><div id=\"Link1\"><a href=\"https:\/\/egonlin.com\/wp-login.php?action=lostpassword\">Forgotten username or password?<\/a><\/div><div id=\"StatusBarFooter\"><\/div><\/div><\/div><div id=aru_remaining_content><\/div>","protected":false},"excerpt":{"rendered":"<p>\u4e00\uff0c\u7ec3\u4e60\u9898 1, \u7b80\u8ff0\u7f16\u8bd1\u578b\u4e0e\u89e3\u91ca\u578b\u8bed\u8a00\u7684\u533a\u522b\uff0c\u4e14\u5206\u522b\u5217\u51fa\u4f60\u77e5\u9053\u7684\u54ea\u4e9b\u8bed\u8a00\u5c5e\u4e8e\u7f16\u8bd1\u578b\uff0c\u54ea\u4e9b\u5c5e\u4e8e\u89e3\u91ca\u578b 2, \u6267 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,281,323],"tags":[],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/7215"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7215"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/7215\/revisions"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}