{"id":959409,"date":"2024-12-27T03:40:22","date_gmt":"2024-12-26T19:40:22","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/959409.html"},"modified":"2024-12-27T03:40:24","modified_gmt":"2024-12-26T19:40:24","slug":"python3%e5%a6%82%e4%bd%95%e8%be%93%e5%85%a5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/959409.html","title":{"rendered":"python3\u5982\u4f55\u8f93\u5165"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25102231\/48b8d76c-1ff1-464c-b700-d472a62f9c33.webp\" alt=\"python3\u5982\u4f55\u8f93\u5165\" \/><\/p>\n<p><p> <strong>\u5728Python3\u4e2d\u8f93\u5165\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u5b9e\u73b0\u3001<code>input()<\/code>\u51fd\u6570\u4f1a\u6682\u505c\u7a0b\u5e8f\u7684\u6267\u884c\uff0c\u5e76\u7b49\u5f85\u7528\u6237\u901a\u8fc7\u952e\u76d8\u8f93\u5165\u5185\u5bb9\u3001\u8f93\u5165\u7684\u5185\u5bb9\u4f1a\u88ab\u4f5c\u4e3a\u5b57\u7b26\u4e32\u8fd4\u56de\uff0c\u53ef\u4ee5\u901a\u8fc7\u53d8\u91cf\u5b58\u50a8\u6216\u8fdb\u884c\u540e\u7eed\u5904\u7406\u3002<\/strong>\u4e0b\u9762\u6211\u4eec\u8be6\u7ec6\u5c55\u5f00\u5982\u4f55\u5728Python3\u4e2d\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\uff0c\u5e76\u63a2\u8ba8\u4e00\u4e9b\u76f8\u5173\u7684\u6ce8\u610f\u4e8b\u9879\u548c\u6280\u5de7\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001BASIC USAGE OF <code>INPUT()<\/code><\/h2>\n<\/p>\n<p><h3>1. \u57fa\u672c\u7528\u6cd5<\/h3>\n<\/p>\n<p><p><code>input()<\/code>\u51fd\u6570\u662fPython3\u4e2d\u7528\u4e8e\u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u6807\u51c6\u51fd\u6570\u3002\u5b83\u4f1a\u7b49\u5f85\u7528\u6237\u8f93\u5165\u5e76\u6309\u4e0b\u56de\u8f66\u952e\uff0c\u7136\u540e\u5c06\u8f93\u5165\u7684\u5185\u5bb9\u4f5c\u4e3a\u5b57\u7b26\u4e32\u8fd4\u56de\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;Please enter something: &quot;)<\/p>\n<p>print(&quot;You entered:&quot;, user_input)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u7a0b\u5e8f\u4f1a\u663e\u793a\u63d0\u793a\u4fe1\u606f\u201cPlease enter something:\u201d\uff0c\u7b49\u5f85\u7528\u6237\u8f93\u5165\u5185\u5bb9\u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u968f\u540e\u5c06\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<p><h3>2. \u6570\u636e\u7c7b\u578b\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>\u7531\u4e8e<code>input()<\/code>\u51fd\u6570\u8fd4\u56de\u7684\u603b\u662f\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5982\u679c\u9700\u8981\u8fdb\u884c\u6570\u503c\u8fd0\u7b97\u6216\u5176\u4ed6\u7c7b\u578b\u7684\u64cd\u4f5c\uff0c\u5fc5\u987b\u8fdb\u884c\u7c7b\u578b\u8f6c\u6362\u3002\u4f8b\u5982\uff0c\u5c06\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">number = int(input(&quot;Enter a number: &quot;))<\/p>\n<p>print(&quot;You entered the number:&quot;, number)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u5c06\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u5982\u679c\u7528\u6237\u8f93\u5165\u7684\u4e0d\u662f\u6709\u6548\u7684\u6570\u5b57\u5b57\u7b26\u4e32\uff0c\u7a0b\u5e8f\u4f1a\u629b\u51fa<code>ValueError<\/code>\u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001ERROR HANDLING AND VALIDATION<\/h2>\n<\/p>\n<p><h3>1. \u9519\u8bef\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u7528\u6237\u8f93\u5165\u65f6\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8f93\u5165\u683c\u5f0f\u4e0d\u6b63\u786e\u7684\u60c5\u51b5\uff0c\u6bd4\u5982\u7528\u6237\u8f93\u5165\u5b57\u6bcd\u800c\u975e\u6570\u5b57\u3002\u4e3a\u4e86\u8ba9\u7a0b\u5e8f\u66f4\u5065\u58ee\uff0c\u9700\u8981\u5bf9\u8fd9\u79cd\u60c5\u51b5\u8fdb\u884c\u5904\u7406\u3002\u53ef\u4ee5\u4f7f\u7528<code>try<\/code>\u548c<code>except<\/code>\u8bed\u53e5\u6765\u5904\u7406\u8f93\u5165\u9519\u8bef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">while True:<\/p>\n<p>    try:<\/p>\n<p>        number = int(input(&quot;Enter an integer: &quot;))<\/p>\n<p>        break<\/p>\n<p>    except ValueError:<\/p>\n<p>        print(&quot;Invalid input. Please enter a valid integer.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u4f1a\u6301\u7eed\u8981\u6c42\u7528\u6237\u8f93\u5165\uff0c\u76f4\u5230\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u6574\u6570\u4e3a\u6b62\u3002<\/p>\n<\/p>\n<p><h3>2. \u8f93\u5165\u9a8c\u8bc1<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u7684\u9519\u8bef\u5904\u7406\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u8f93\u5165\u5185\u5bb9\u8fdb\u884c\u66f4\u590d\u6742\u7684\u9a8c\u8bc1\uff0c\u4f8b\u5982\u68c0\u67e5\u8f93\u5165\u662f\u5426\u5728\u67d0\u4e2a\u8303\u56f4\u5185\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">while True:<\/p>\n<p>    try:<\/p>\n<p>        age = int(input(&quot;Enter your age: &quot;))<\/p>\n<p>        if 0 &lt;= age &lt;= 120:<\/p>\n<p>            break<\/p>\n<p>        else:<\/p>\n<p>            print(&quot;Age must be between 0 and 120.&quot;)<\/p>\n<p>    except ValueError:<\/p>\n<p>        print(&quot;Invalid input. Please enter a valid integer.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u786e\u4fdd\u7528\u6237\u8f93\u5165\u7684\u5e74\u9f84\u57280\u5230120\u4e4b\u95f4\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001MULTILINE INPUTS AND ADVANCED USAGE<\/h2>\n<\/p>\n<p><h3>1. \u591a\u884c\u8f93\u5165<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u9700\u8981\u4ece\u7528\u6237\u90a3\u91cc\u83b7\u53d6\u591a\u884c\u8f93\u5165\uff0c\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u548c<code>input()<\/code>\u51fd\u6570\u5b9e\u73b0\uff0c\u76f4\u5230\u7528\u6237\u8f93\u5165\u4e00\u4e2a\u7279\u5b9a\u7684\u7ed3\u675f\u6807\u8bb0\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Enter your text (type &#39;END&#39; to finish):&quot;)<\/p>\n<p>lines = []<\/p>\n<p>while True:<\/p>\n<p>    line = input()<\/p>\n<p>    if line.upper() == &#39;END&#39;:<\/p>\n<p>        break<\/p>\n<p>    lines.append(line)<\/p>\n<p>print(&quot;You entered:&quot;)<\/p>\n<p>for line in lines:<\/p>\n<p>    print(line)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u9ad8\u7ea7\u7528\u6cd5<\/h3>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u4e00\u4e9b\u66f4\u9ad8\u7ea7\u7684\u8f93\u5165\u65b9\u6cd5\uff0c\u6bd4\u5982\u4f7f\u7528<code>sys.stdin<\/code>\u6765\u8bfb\u53d6\u8f93\u5165\u6d41\u4e2d\u7684\u6570\u636e\uff0c\u9002\u7528\u4e8e\u9700\u8981\u4ece\u6587\u4ef6\u6216\u5176\u4ed6\u8f93\u5165\u6e90\u8bfb\u53d6\u6570\u636e\u7684\u60c5\u51b5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>print(&quot;Reading from stdin. Use Ctrl+D (Unix) or Ctrl+Z (Windows) to end input:&quot;)<\/p>\n<p>for line in sys.stdin:<\/p>\n<p>    print(&quot;Line:&quot;, line.strip())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u901a\u5e38\u7528\u4e8e\u811a\u672c\u5316\u64cd\u4f5c\u6216\u9700\u8981\u5904\u7406\u5927\u91cf\u8f93\u5165\u6570\u636e\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001PRACTICAL APPLICATIONS<\/h2>\n<\/p>\n<p><h3>1. \u7528\u6237\u4ea4\u4e92\u5f0f\u7a0b\u5e8f<\/h3>\n<\/p>\n<p><p><code>input()<\/code>\u51fd\u6570\u5728\u521b\u5efa\u7528\u6237\u4ea4\u4e92\u5f0f\u7a0b\u5e8f\u4e2d\u975e\u5e38\u6709\u7528\uff0c\u6bd4\u5982\u7b80\u5355\u7684\u8ba1\u7b97\u5668\u3001\u95ee\u5377\u8c03\u67e5\u7b49\u3002\u901a\u8fc7<code>input()<\/code>\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff0c\u7a0b\u5e8f\u53ef\u4ee5\u6839\u636e\u8f93\u5165\u5185\u5bb9\u8fdb\u884c\u4e0d\u540c\u7684\u64cd\u4f5c\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def calculator():<\/p>\n<p>    while True:<\/p>\n<p>        operation = input(&quot;Enter operation (+, -, *, \/) or &#39;quit&#39; to exit: &quot;)<\/p>\n<p>        if operation.lower() == &#39;quit&#39;:<\/p>\n<p>            break<\/p>\n<p>        if operation in (&#39;+&#39;, &#39;-&#39;, &#39;*&#39;, &#39;\/&#39;):<\/p>\n<p>            try:<\/p>\n<p>                num1 = float(input(&quot;Enter first number: &quot;))<\/p>\n<p>                num2 = float(input(&quot;Enter second number: &quot;))<\/p>\n<p>                if operation == &#39;+&#39;:<\/p>\n<p>                    print(&quot;Result:&quot;, num1 + num2)<\/p>\n<p>                elif operation == &#39;-&#39;:<\/p>\n<p>                    print(&quot;Result:&quot;, num1 - num2)<\/p>\n<p>                elif operation == &#39;*&#39;:<\/p>\n<p>                    print(&quot;Result:&quot;, num1 * num2)<\/p>\n<p>                elif operation == &#39;\/&#39;:<\/p>\n<p>                    if num2 != 0:<\/p>\n<p>                        print(&quot;Result:&quot;, num1 \/ num2)<\/p>\n<p>                    else:<\/p>\n<p>                        print(&quot;Error: Division by zero.&quot;)<\/p>\n<p>            except ValueError:<\/p>\n<p>                print(&quot;Invalid input. Please enter numeric values.&quot;)<\/p>\n<p>        else:<\/p>\n<p>            print(&quot;Invalid operation. Please enter a valid operation.&quot;)<\/p>\n<p>calculator()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u6570\u636e\u5904\u7406\u811a\u672c<\/h3>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5904\u7406\u811a\u672c\u4e2d\uff0c<code>input()<\/code>\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u52a8\u6001\u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u53c2\u6570\uff0c\u4ece\u800c\u4f7f\u5f97\u811a\u672c\u66f4\u52a0\u901a\u7528\u548c\u7075\u6d3b\u3002\u4f8b\u5982\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u8981\u5904\u7406\u7684\u6570\u636e\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u6216\u8005\u6307\u5b9a\u5904\u7406\u9009\u9879\u3002<\/p>\n<\/p>\n<p><h3>3. \u547d\u4ee4\u884c\u5de5\u5177<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u867d\u7136\u901a\u5e38\u4f7f\u7528\u547d\u4ee4\u884c\u53c2\u6570\u6765\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff0c\u4f46<code>input()<\/code>\u51fd\u6570\u4ecd\u7136\u53ef\u4ee5\u7528\u4e8e\u5728\u8fd0\u884c\u65f6\u83b7\u53d6\u989d\u5916\u7684\u8f93\u5165\u4fe1\u606f\uff0c\u7279\u522b\u662f\u9700\u8981\u4ea4\u4e92\u65f6\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001BEST PRACTICES<\/h2>\n<\/p>\n<p><h3>1. \u63d0\u793a\u4fe1\u606f\u660e\u786e<\/h3>\n<\/p>\n<p><p>\u603b\u662f\u786e\u4fdd<code>input()<\/code>\u51fd\u6570\u7684\u63d0\u793a\u4fe1\u606f\u662f\u660e\u786e\u7684\uff0c\u7528\u6237\u80fd\u591f\u7406\u89e3\u8f93\u5165\u7684\u8981\u6c42\u3002\u8fd9\u5c06\u51cf\u5c11\u7528\u6237\u8f93\u5165\u9519\u8bef\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<\/p>\n<p><h3>2. \u5904\u7406\u610f\u5916\u8f93\u5165<\/h3>\n<\/p>\n<p><p>\u6c38\u8fdc\u8981\u8003\u8651\u5230\u7528\u6237\u53ef\u80fd\u7684\u9519\u8bef\u8f93\u5165\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u9002\u5f53\u7684\u5904\u7406\u3002\u8fd9\u4e0d\u4ec5\u5305\u62ec\u6570\u636e\u7c7b\u578b\u9519\u8bef\uff0c\u8fd8\u5305\u62ec\u683c\u5f0f\u9519\u8bef\u548c\u903b\u8f91\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h3>3. \u8f93\u5165\u9650\u5236<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u9700\u8981\u9650\u5236\u8f93\u5165\u8303\u56f4\u7684\u60c5\u51b5\uff0c\u660e\u786e\u544a\u77e5\u7528\u6237\u9650\u5236\u6761\u4ef6\uff0c\u5e76\u5728\u9a8c\u8bc1\u5931\u8d25\u65f6\u7ed9\u4e88\u6e05\u6670\u7684\u53cd\u9988\u3002<\/p>\n<\/p>\n<p><h3>4. \u4f7f\u7528\u51fd\u6570\u5c01\u88c5<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u590d\u6742\u7684\u8f93\u5165\u5904\u7406\u903b\u8f91\uff0c\u8003\u8651\u4f7f\u7528\u51fd\u6570\u8fdb\u884c\u5c01\u88c5\uff0c\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u6280\u5de7\u548c\u65b9\u6cd5\uff0cPython3\u7684<code>input()<\/code>\u51fd\u6570\u53ef\u4ee5\u88ab\u6709\u6548\u5730\u7528\u4e8e\u5404\u79cd\u7528\u6237\u8f93\u5165\u573a\u666f\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u66f4\u52a0\u5065\u58ee\u548c\u7528\u6237\u53cb\u597d\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>Python3\u4e2d\u5982\u4f55\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff1f<\/strong><br \/>\u5728Python3\u4e2d\uff0c\u83b7\u53d6\u7528\u6237\u8f93\u5165\u901a\u5e38\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u3002\u8fd9\u4e2a\u51fd\u6570\u4f1a\u6682\u505c\u7a0b\u5e8f\u7684\u6267\u884c\uff0c\u7b49\u5f85\u7528\u6237\u8f93\u5165\u6570\u636e\u3002\u5f53\u7528\u6237\u6309\u4e0b\u56de\u8f66\u952e\u540e\uff0c\u8f93\u5165\u7684\u5185\u5bb9\u5c06\u4f5c\u4e3a\u5b57\u7b26\u4e32\u8fd4\u56de\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff1a<\/p>\n<pre><code class=\"language-python\">user_input = input(&quot;\u8bf7\u8f93\u5165\u60a8\u7684\u5185\u5bb9: &quot;)\nprint(&quot;\u60a8\u8f93\u5165\u7684\u5185\u5bb9\u662f:&quot;, user_input)\n<\/code><\/pre>\n<p><strong>\u5728Python3\u4e2d\u53ef\u4ee5\u8f93\u5165\u54ea\u4e9b\u7c7b\u578b\u7684\u6570\u636e\uff1f<\/strong><br \/>\u867d\u7136<code>input()<\/code>\u51fd\u6570\u8fd4\u56de\u7684\u59cb\u7ec8\u662f\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u4f46\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u4efb\u4f55\u5f62\u5f0f\u7684\u6587\u672c\u6570\u636e\u3002\u5982\u679c\u9700\u8981\u5c06\u8f93\u5165\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u5176\u4ed6\u7c7b\u578b\uff08\u5982\u6574\u6570\u6216\u6d6e\u70b9\u6570\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u578b\u8f6c\u6362\u51fd\u6570\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">num = int(input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570: &quot;))\nprint(&quot;\u60a8\u8f93\u5165\u7684\u6574\u6570\u662f:&quot;, num)\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5904\u7406\u7528\u6237\u5728Python3\u4e2d\u8f93\u5165\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u5728\u5904\u7406\u7528\u6237\u8f93\u5165\u65f6\uff0c\u7a0b\u5e8f\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef\u7684\u8f93\u5165\u683c\u5f0f\u3002\u4e3a\u4e86\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try...except<\/code>\u8bed\u53e5\u6765\u6355\u83b7\u53ef\u80fd\u7684\u5f02\u5e38\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">try:\n    num = int(input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570: &quot;))\n    print(&quot;\u60a8\u8f93\u5165\u7684\u6574\u6570\u662f:&quot;, num)\nexcept ValueError:\n    print(&quot;\u8f93\u5165\u65e0\u6548\uff0c\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u6574\u6570\u3002&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u5728\u9047\u5230\u9519\u8bef\u65f6\u4e0d\u4f1a\u5d29\u6e83\uff0c\u5e76\u7ed9\u51fa\u76f8\u5e94\u7684\u63d0\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python3\u4e2d\u8f93\u5165\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528input()\u51fd\u6570\u5b9e\u73b0\u3001input()\u51fd\u6570\u4f1a\u6682\u505c\u7a0b\u5e8f\u7684\u6267\u884c\uff0c\u5e76\u7b49\u5f85\u7528\u6237\u901a\u8fc7\u952e [&hellip;]","protected":false},"author":3,"featured_media":959416,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/959409"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=959409"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/959409\/revisions"}],"predecessor-version":[{"id":959417,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/959409\/revisions\/959417"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/959416"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=959409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=959409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=959409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}