{"id":984479,"date":"2024-12-27T07:28:32","date_gmt":"2024-12-26T23:28:32","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/984479.html"},"modified":"2024-12-27T07:28:35","modified_gmt":"2024-12-26T23:28:35","slug":"python%e5%a6%82%e4%bd%95%e8%be%93%e5%85%a5%e5%a4%9a%e4%b8%aa%e6%95%b0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/984479.html","title":{"rendered":"python\u5982\u4f55\u8f93\u5165\u591a\u4e2a\u6570"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24212056\/d72ccf16-7b3a-4b16-8037-f58279d9ff2f.webp\" alt=\"python\u5982\u4f55\u8f93\u5165\u591a\u4e2a\u6570\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u8f93\u5165\u591a\u4e2a\u6570\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u7ed3\u5408\u5b57\u7b26\u4e32\u7684\u62c6\u5206\u548c\u7c7b\u578b\u8f6c\u6362\u5b9e\u73b0\u3001\u4f7f\u7528<code>map()<\/code>\u51fd\u6570\u7b80\u5316\u8f93\u5165\u6d41\u7a0b\u3001\u5229\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u8fdb\u884c\u8f93\u5165\u5904\u7406\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u901a\u8fc7<code>input()<\/code>\u51fd\u6570\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff0c\u7136\u540e\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>split()<\/code>\u65b9\u6cd5\u5c06\u8f93\u5165\u5206\u5272\u4e3a\u591a\u4e2a\u90e8\u5206\uff0c\u518d\u5c06\u6bcf\u4e2a\u90e8\u5206\u8f6c\u6362\u4e3a\u9700\u8981\u7684\u6570\u503c\u7c7b\u578b\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u8be6\u7ec6\u8bf4\u660e\u5982\u4f55\u5728Python\u4e2d\u8f93\u5165\u591a\u4e2a\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u4ece\u591a\u4e2a\u65b9\u9762\u8fdb\u884c\u63a2\u8ba8\uff0c\u5305\u62ec\u57fa\u672c\u65b9\u6cd5\u3001\u8fdb\u9636\u6280\u5de7\u3001\u4ee5\u53ca\u5728\u4e0d\u540c\u5e94\u7528\u573a\u666f\u4e2d\u7684\u4f7f\u7528\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001BASIC METHOD: STRING SPLITTING AND TYPE CONVERSION<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u901a\u8fc7<code>input()<\/code>\u51fd\u6570\u83b7\u53d6\u7528\u6237\u8f93\u5165\uff0c\u7136\u540e\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>split()<\/code>\u65b9\u6cd5\u5c06\u8f93\u5165\u5206\u5272\u4e3a\u591a\u4e2a\u90e8\u5206\uff0c\u518d\u5c06\u6bcf\u4e2a\u90e8\u5206\u8f6c\u6362\u4e3a\u9700\u8981\u7684\u6570\u503c\u7c7b\u578b\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u4e14\u6613\u4e8e\u7406\u89e3\uff0c\u975e\u5e38\u9002\u5408\u5165\u95e8\u7ea7\u7528\u6237\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528<code>input()<\/code>\u548c<code>split()<\/code><\/h4>\n<\/p>\n<p><p>\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e2d\uff0c\u9996\u5148\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u83b7\u53d6\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u4f1a\u8f93\u5165\u4ee5\u7a7a\u683c\u3001\u9017\u53f7\u6216\u5176\u4ed6\u5206\u9694\u7b26\u5206\u9694\u7684\u6570\u503c\u3002\u7136\u540e\uff0c\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>split()<\/code>\u65b9\u6cd5\u5c06\u8f93\u5165\u5b57\u7b26\u4e32\u62c6\u5206\u4e3a\u4e00\u4e2a\u5217\u8868\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>int()<\/code>\u6216<code>float()<\/code>\u7b49\u51fd\u6570\u5c06\u6bcf\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u8f93\u5165\u591a\u4e2a\u6574\u6570<\/p>\n<p>input_string = input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u6574\u6570\uff0c\u7528\u7a7a\u683c\u5206\u9694: &quot;)<\/p>\n<p>numbers = input_string.split()  # \u9ed8\u8ba4\u6309\u7a7a\u683c\u5206\u5272<\/p>\n<p>numbers = [int(num) for num in numbers]  # \u8f6c\u6362\u4e3a\u6574\u6570\u5217\u8868<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8be6\u7ec6\u8bf4\u660e<\/h4>\n<\/p>\n<p><p>\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e2d\uff0c<code>split()<\/code>\u65b9\u6cd5\u662f\u5173\u952e\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u53c2\u6570\u4f5c\u4e3a\u5206\u9694\u7b26\u3002\u5982\u679c\u4e0d\u6307\u5b9a\u53c2\u6570\uff0c\u9ed8\u8ba4\u4f1a\u6309\u7a7a\u683c\u8fdb\u884c\u5206\u5272\u3002\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u53ef\u4ee5\u9ad8\u6548\u5730\u5c06\u6bcf\u4e2a\u5b57\u7b26\u4e32\u5143\u7d20\u8f6c\u6362\u4e3a\u6240\u9700\u7684\u6570\u503c\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001ADVANCED TECHNIQUE: USING MAP FUNCTION<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u4ee3\u7801\u7684\u7b80\u6d01\u6027\u548c\u53ef\u8bfb\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528<code>map()<\/code>\u51fd\u6570\u3002<code>map()<\/code>\u51fd\u6570\u53ef\u4ee5\u7b80\u5316\u591a\u4e2a\u6570\u503c\u7c7b\u578b\u8f6c\u6362\u7684\u8fc7\u7a0b\uff0c\u4f7f\u4ee3\u7801\u66f4\u52a0\u4f18\u96c5\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528<code>map()<\/code>\u51fd\u6570<\/h4>\n<\/p>\n<p><p><code>map()<\/code>\u51fd\u6570\u63a5\u53d7\u4e00\u4e2a\u51fd\u6570\u548c\u4e00\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\uff0c\u5e76\u5c06\u51fd\u6570\u5e94\u7528\u4e8e\u53ef\u8fed\u4ee3\u5bf9\u8c61\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u8fed\u4ee3\u5668\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u4f7f\u7528 map() \u8f93\u5165\u591a\u4e2a\u6574\u6570<\/p>\n<p>input_string = input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u6574\u6570\uff0c\u7528\u7a7a\u683c\u5206\u9694: &quot;)<\/p>\n<p>numbers = list(map(int, input_string.split()))<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8be6\u7ec6\u8bf4\u660e<\/h4>\n<\/p>\n<p><p><code>map()<\/code>\u51fd\u6570\u5728\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u6027\u80fd\u4f18\u8d8a\uff0c\u56e0\u4e3a\u5b83\u76f4\u63a5\u751f\u6210\u8fed\u4ee3\u5668\uff0c\u907f\u514d\u4e86\u4e0d\u5fc5\u8981\u7684\u4e2d\u95f4\u5bf9\u8c61\u3002\u5728\u9700\u8981\u8fdb\u884c\u5927\u89c4\u6a21\u6570\u636e\u8f6c\u6362\u65f6\uff0c<code>map()<\/code>\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001LIST COMPREHENSIONS<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u7b80\u6d01\u7684\u65b9\u5f0f\u6765\u521b\u5efa\u5217\u8868\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5c06\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u503c\u5217\u8868\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f<\/h4>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u5f0f\u53ef\u4ee5\u5728\u4e00\u884c\u4ee3\u7801\u4e2d\u5b8c\u6210\u8f93\u5165\u3001\u5206\u5272\u548c\u8f6c\u6362\u7684\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u8f93\u5165\u591a\u4e2a\u6d6e\u70b9\u6570<\/p>\n<p>numbers = [float(num) for num in input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u6d6e\u70b9\u6570\uff0c\u7528\u7a7a\u683c\u5206\u9694: &quot;).split()]<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8be6\u7ec6\u8bf4\u660e<\/h4>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u5f0f\u4e0d\u4ec5\u80fd\u4f7f\u4ee3\u7801\u66f4\u5177\u53ef\u8bfb\u6027\uff0c\u8fd8\u80fd\u663e\u8457\u51cf\u5c11\u4ee3\u7801\u884c\u6570\uff0c\u63d0\u9ad8\u7f16\u5199\u6548\u7387\u3002\u5728\u5904\u7406\u7b80\u5355\u8f6c\u6362\u65f6\uff0c\u5b83\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001APPLICATION SCENARIOS<\/h3>\n<\/p>\n<p><p>\u5728\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u4e0b\uff0c\u8f93\u5165\u591a\u4e2a\u6570\u7684\u9700\u6c42\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\u53ca\u5176\u5904\u7406\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1. \u8f93\u5165\u56fa\u5b9a\u6570\u91cf\u7684\u6570\u503c<\/h4>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u573a\u666f\u4e2d\uff0c\u7528\u6237\u9700\u8981\u8f93\u5165\u56fa\u5b9a\u6570\u91cf\u7684\u6570\u503c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u901a\u8fc7\u63d0\u793a\u7528\u6237\u8f93\u5165\u7279\u5b9a\u6570\u91cf\u7684\u6570\u503c\uff0c\u5e76\u5728\u8f93\u5165\u65f6\u8fdb\u884c\u68c0\u67e5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u8f93\u5165\u4e09\u4e2a\u6574\u6570<\/p>\n<p>while True:<\/p>\n<p>    input_string = input(&quot;\u8bf7\u8f93\u5165\u4e09\u4e2a\u6574\u6570\uff0c\u7528\u7a7a\u683c\u5206\u9694: &quot;)<\/p>\n<p>    numbers = input_string.split()<\/p>\n<p>    if len(numbers) == 3:<\/p>\n<p>        numbers = list(map(int, numbers))<\/p>\n<p>        break<\/p>\n<p>    else:<\/p>\n<p>        print(&quot;\u8f93\u5165\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u4e09\u4e2a\u6574\u6570\u3002&quot;)<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8f93\u5165\u52a8\u6001\u6570\u91cf\u7684\u6570\u503c<\/h4>\n<\/p>\n<p><p>\u5f53\u7528\u6237\u4e0d\u786e\u5b9a\u8f93\u5165\u591a\u5c11\u4e2a\u6570\u503c\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u5904\u7406\u7528\u6237\u8f93\u5165\uff0c\u76f4\u5230\u7528\u6237\u8f93\u5165\u7279\u5b9a\u7684\u7ed3\u675f\u6807\u8bc6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u8f93\u5165\u591a\u4e2a\u6574\u6570\uff0c\u76f4\u5230\u8f93\u5165 &#39;end&#39; \u7ed3\u675f<\/p>\n<p>numbers = []<\/p>\n<p>while True:<\/p>\n<p>    input_string = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570\uff0c\u8f93\u5165 &#39;end&#39; \u7ed3\u675f: &quot;)<\/p>\n<p>    if input_string.lower() == &#39;end&#39;:<\/p>\n<p>        break<\/p>\n<p>    numbers.append(int(input_string))<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001ERROR HANDLING<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5904\u7406\u7528\u6237\u8f93\u5165\u7684\u9519\u8bef\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u53ef\u4ee5\u901a\u8fc7\u6355\u83b7\u5f02\u5e38\u6765\u5904\u7406\u7528\u6237\u8f93\u5165\u7684\u65e0\u6548\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f8b\u5b50\uff1a\u5904\u7406\u8f93\u5165\u9519\u8bef<\/p>\n<p>numbers = []<\/p>\n<p>while True:<\/p>\n<p>    input_string = input(&quot;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570\uff0c\u8f93\u5165 &#39;end&#39; \u7ed3\u675f: &quot;)<\/p>\n<p>    if input_string.lower() == &#39;end&#39;:<\/p>\n<p>        break<\/p>\n<p>    try:<\/p>\n<p>        number = int(input_string)<\/p>\n<p>        numbers.append(number)<\/p>\n<p>    except ValueError:<\/p>\n<p>        print(&quot;\u8f93\u5165\u65e0\u6548\uff0c\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570\u3002&quot;)<\/p>\n<p>print(numbers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728Python\u4e2d\u7075\u6d3b\u4e14\u9ad8\u6548\u5730\u8f93\u5165\u591a\u4e2a\u6570\u503c\u3002\u6839\u636e\u4e0d\u540c\u7684\u9700\u6c42\u548c\u573a\u666f\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u7f16\u5199\u51fa\u66f4\u4f18\u96c5\u548c\u5065\u58ee\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8f93\u5165\u591a\u4e2a\u6570\u5b57\u5e76\u5b58\u50a8\u5b83\u4eec\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>input()<\/code>\u51fd\u6570\u6765\u63a5\u6536\u7528\u6237\u8f93\u5165\u7684\u591a\u4e2a\u6570\u5b57\u3002\u901a\u5e38\uff0c\u60a8\u53ef\u4ee5\u8ba9\u7528\u6237\u7528\u7a7a\u683c\u6216\u9017\u53f7\u5206\u9694\u6570\u5b57\uff0c\u7136\u540e\u4f7f\u7528<code>split()<\/code>\u65b9\u6cd5\u5c06\u8f93\u5165\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u4e00\u4e2a\u5217\u8868\u3002\u793a\u4f8b\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">numbers = input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u6570\u5b57\uff0c\u7528\u7a7a\u683c\u5206\u9694\uff1a&quot;).split()\nnumbers = [int(num) for num in numbers]  # \u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u60a8\u5c31\u80fd\u5c06\u7528\u6237\u8f93\u5165\u7684\u591a\u4e2a\u6570\u5b57\u5b58\u50a8\u5728\u4e00\u4e2a\u5217\u8868\u4e2d\uff0c\u65b9\u4fbf\u540e\u7eed\u5904\u7406\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u7528\u6237\u8f93\u5165\u7684\u591a\u4e2a\u6570\u5b57\u4ee5\u8fdb\u884c\u8ba1\u7b97\uff1f<\/strong><br \/>\u63a5\u6536\u591a\u4e2a\u6570\u5b57\u540e\uff0c\u60a8\u53ef\u80fd\u60f3\u8981\u5bf9\u8fd9\u4e9b\u6570\u5b57\u8fdb\u884c\u8ba1\u7b97\uff0c\u4f8b\u5982\u6c42\u548c\u3001\u5e73\u5747\u503c\u6216\u6700\u5927\u503c\u7b49\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684\u51fd\u6570\uff0c\u5982<code>sum()<\/code>\u3001<code>max()<\/code>\u548c<code>min()<\/code>\uff0c\u5bf9\u5217\u8868\u8fdb\u884c\u64cd\u4f5c\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">total = sum(numbers)\naverage = total \/ len(numbers)\nmax_value = max(numbers)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5bf9\u7528\u6237\u8f93\u5165\u7684\u591a\u4e2a\u6570\u5b57\u8fdb\u884c\u5404\u79cd\u8ba1\u7b97\u3002<\/p>\n<p><strong>\u5982\u4f55\u9a8c\u8bc1\u7528\u6237\u8f93\u5165\u7684\u6570\u5b57\u683c\u5f0f\uff1f<\/strong><br \/>\u5728\u8f93\u5165\u591a\u4e2a\u6570\u5b57\u65f6\uff0c\u786e\u4fdd\u7528\u6237\u8f93\u5165\u7684\u683c\u5f0f\u6b63\u786e\u662f\u5f88\u91cd\u8981\u7684\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>try-except<\/code>\u8bed\u53e5\u6765\u6355\u83b7\u8f93\u5165\u9519\u8bef\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">try:\n    numbers = input(&quot;\u8bf7\u8f93\u5165\u591a\u4e2a\u6570\u5b57\uff0c\u7528\u7a7a\u683c\u5206\u9694\uff1a&quot;).split()\n    numbers = [int(num) for num in numbers]  # \u8f6c\u6362\u4e3a\u6574\u6570\nexcept ValueError:\n    print(&quot;\u8bf7\u8f93\u5165\u6709\u6548\u7684\u6570\u5b57\uff01&quot;)\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u9a8c\u8bc1\u7528\u6237\u8f93\u5165\uff0c\u5e76\u63d0\u793a\u7528\u6237\u7ea0\u6b63\u9519\u8bef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u8f93\u5165\u591a\u4e2a\u6570\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528input()\u51fd\u6570\u7ed3\u5408\u5b57\u7b26\u4e32\u7684\u62c6\u5206\u548c\u7c7b\u578b\u8f6c\u6362\u5b9e\u73b0\u3001\u4f7f\u7528map()\u51fd\u6570\u7b80 [&hellip;]","protected":false},"author":3,"featured_media":984483,"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\/984479"}],"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=984479"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984479\/revisions"}],"predecessor-version":[{"id":984487,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/984479\/revisions\/984487"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/984483"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=984479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=984479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=984479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}