{"id":1014162,"date":"2024-12-27T11:53:53","date_gmt":"2024-12-27T03:53:53","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1014162.html"},"modified":"2024-12-27T11:53:56","modified_gmt":"2024-12-27T03:53:56","slug":"python%e5%a6%82%e4%bd%95%e8%ae%a9%e6%95%b0%e6%8d%ae%e7%9b%b8%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1014162.html","title":{"rendered":"python\u5982\u4f55\u8ba9\u6570\u636e\u76f8\u52a0"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25094354\/a3243013-2d99-4c9c-9e12-f69f3b8119bd.webp\" alt=\"python\u5982\u4f55\u8ba9\u6570\u636e\u76f8\u52a0\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\uff0c\u53ef\u4ee5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\uff08<code>+<\/code>\uff09\u3001<code>sum()<\/code>\u51fd\u6570\u3001\u5217\u8868\u63a8\u5bfc\u3001<code>numpy<\/code>\u5e93\u7b49\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u7b80\u5355\u7684\u6570\u636e\u7c7b\u578b\uff08\u5982\u6574\u6570\u3001\u6d6e\u70b9\u6570\uff09\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\u8fdb\u884c\u76f8\u52a0\uff1b\u5176\u6b21\uff0c\u82e5\u662f\u5217\u8868\u3001\u5143\u7ec4\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u6216\u5217\u8868\u63a8\u5bfc\u8fdb\u884c\u6570\u636e\u76f8\u52a0\uff1b\u6700\u540e\uff0c\u5bf9\u4e8e\u591a\u7ef4\u6570\u7ec4\uff0c<code>numpy<\/code>\u5e93\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u65b9\u6cd5\u6765\u8fdb\u884c\u76f8\u52a0\u64cd\u4f5c\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u8bb2\u89e3\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u7b80\u5355\u6570\u636e\u7c7b\u578b\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u7b80\u5355\u7684\u6570\u636e\u7c7b\u578b\u5982\u6574\u6570\u548c\u6d6e\u70b9\u6570\uff0cPython\u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26<code>+<\/code>\u8fdb\u884c\u76f8\u52a0\u64cd\u4f5c\u3002\u8fd9\u662f\u6700\u57fa\u672c\u548c\u76f4\u89c2\u7684\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">a = 10<\/p>\n<p>b = 5.5<\/p>\n<p>result = a + b<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a15.5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u53d8\u91cf<code>a<\/code>\u548c<code>b<\/code>\u5206\u522b\u4e3a\u6574\u6570\u548c\u6d6e\u70b9\u6570\uff0c\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u5b83\u4eec\u76f8\u52a0\u5e76\u8f93\u51fa\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5e76\u4e14\u5728\u64cd\u4f5c\u65f6\u4e0d\u9700\u8981\u5bfc\u5165\u989d\u5916\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5217\u8868\u4e0e\u5143\u7ec4\u4e2d\u7684\u6570\u636e\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u5217\u8868\u548c\u5143\u7ec4\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u6765\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u4e14\u6613\u4e8e\u7406\u89e3\uff0c\u9002\u7528\u4e8e\u4e00\u7ef4\u7684\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">numbers = [1, 2, 3, 4, 5]<\/p>\n<p>total = sum(numbers)<\/p>\n<p>print(total)  # \u8f93\u51fa\uff1a15<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c<code>sum()<\/code>\u51fd\u6570\u81ea\u52a8\u904d\u5386\u5217\u8868\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u5176\u76f8\u52a0\uff0c\u6700\u7ec8\u8fd4\u56de\u603b\u548c\u3002\u5bf9\u4e8e\u5143\u7ec4\uff0c\u64cd\u4f5c\u65b9\u6cd5\u7c7b\u4f3c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">numbers_tuple = (1, 2, 3, 4, 5)<\/p>\n<p>total_tuple = sum(numbers_tuple)<\/p>\n<p>print(total_tuple)  # \u8f93\u51fa\uff1a15<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u8fdb\u884c\u6570\u636e\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5217\u8868\u63a8\u5bfc\u662f\u4e00\u79cd\u7b80\u6d01\u7684\u8bed\u6cd5\uff0c\u53ef\u4ee5\u7528\u6765\u751f\u6210\u65b0\u7684\u5217\u8868\u3002\u5728\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u7684\u64cd\u4f5c\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u5728\u5904\u7406\u7b80\u5355\u7684\u4e00\u7ef4\u6570\u636e\u65f6\u53ef\u80fd\u663e\u5f97\u7e41\u7410\uff0c\u4f46\u5728\u9700\u8981\u5bf9\u6570\u636e\u8fdb\u884c\u8fc7\u6ee4\u6216\u8f6c\u6362\u65f6\uff0c\u5b83\u663e\u5f97\u975e\u5e38\u5f3a\u5927\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">numbers = [1, 2, 3, 4, 5]<\/p>\n<p>squared_sum = sum([x2 for x in numbers])<\/p>\n<p>print(squared_sum)  # \u8f93\u51fa\uff1a55<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u751f\u6210\u4e86\u4e00\u4e2a\u65b0\u7684\u5217\u8868\uff0c\u5176\u4e2d\u7684\u5143\u7d20\u4e3a\u539f\u5217\u8868\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u5e73\u65b9\u3002\u7136\u540e\uff0c<code>sum()<\/code>\u51fd\u6570\u7528\u4e8e\u6c42\u548c\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528numpy\u5e93\u8fdb\u884c\u591a\u7ef4\u6570\u7ec4\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u591a\u7ef4\u6570\u636e\u7ed3\u6784\uff0c<code>numpy<\/code>\u5e93\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u3002<code>numpy<\/code>\u662f\u4e00\u4e2a\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u8bb8\u591a\u5f3a\u5927\u7684\u529f\u80fd\u6765\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u4e86<code>numpy<\/code>\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>numpy<\/code>\u5e93\u4e2d\u7684\u51fd\u6570\u8fdb\u884c\u6570\u7ec4\u76f8\u52a0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e24\u4e2a\u4e8c\u7ef4\u6570\u7ec4<\/strong><\/h2>\n<p>array1 = np.array([[1, 2, 3], [4, 5, 6]])<\/p>\n<p>array2 = np.array([[7, 8, 9], [10, 11, 12]])<\/p>\n<h2><strong>\u4f7f\u7528numpy\u7684\u52a0\u6cd5\u8fd0\u7b97\u8fdb\u884c\u76f8\u52a0<\/strong><\/h2>\n<p>result = np.add(array1, array2)<\/p>\n<p>print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e24\u4e2a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u5e76\u4f7f\u7528<code>numpy<\/code>\u7684<code>add()<\/code>\u51fd\u6570\u5bf9\u5b83\u4eec\u8fdb\u884c\u5143\u7d20\u7ea7\u7684\u76f8\u52a0\u3002<code>numpy<\/code>\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u5404\u79cd\u64cd\u4f5c\uff0c\u6bd4\u5982<code>sum()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u6cbf\u6307\u5b9a\u8f74\u8fdb\u884c\u6c42\u548c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6cbf\u8f740\u8fdb\u884c\u6c42\u548c\uff08\u7eb5\u5411\uff09<\/p>\n<p>sum_along_axis0 = np.sum(array1, axis=0)<\/p>\n<p>print(sum_along_axis0)  # \u8f93\u51fa\uff1a[5 7 9]<\/p>\n<h2><strong>\u6cbf\u8f741\u8fdb\u884c\u6c42\u548c\uff08\u6a2a\u5411\uff09<\/strong><\/h2>\n<p>sum_along_axis1 = np.sum(array1, axis=1)<\/p>\n<p>print(sum_along_axis1)  # \u8f93\u51fa\uff1a[ 6 15]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u5b57\u5178\u4e2d\u6570\u636e\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5b57\u5178\u662f\u4e00\u79cd\u7528\u4e8e\u5b58\u50a8\u952e\u503c\u5bf9\u7684\u6570\u636e\u7ed3\u6784\u3002\u8981\u5bf9\u5b57\u5178\u4e2d\u7684\u6570\u503c\u8fdb\u884c\u76f8\u52a0\uff0c\u53ef\u4ee5\u904d\u5386\u5b57\u5178\u7684\u503c\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data = {&#39;a&#39;: 10, &#39;b&#39;: 20, &#39;c&#39;: 30}<\/p>\n<p>total_value = sum(data.values())<\/p>\n<p>print(total_value)  # \u8f93\u51fa\uff1a60<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>data.values()<\/code>\u6765\u83b7\u53d6\u5b57\u5178\u4e2d\u6240\u6709\u7684\u503c\uff0c\u7136\u540e\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u8fdb\u884c\u6c42\u548c\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u5b57\u7b26\u4e32\u6570\u636e\u76f8\u52a0<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5b57\u7b26\u4e32\u4e5f\u53ef\u4ee5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\u8fdb\u884c\u76f8\u52a0\uff0c\u8fd9\u5b9e\u9645\u4e0a\u662f\u5b57\u7b26\u4e32\u7684\u62fc\u63a5\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">str1 = &quot;Hello&quot;<\/p>\n<p>str2 = &quot;World&quot;<\/p>\n<p>result_str = str1 + &quot; &quot; + str2<\/p>\n<p>print(result_str)  # \u8f93\u51fa\uff1aHello World<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5b57\u7b26\u4e32\u76f8\u52a0\u5e76\u4e0d\u662f\u6570\u503c\u610f\u4e49\u4e0a\u7684\u76f8\u52a0\uff0c\u800c\u662f\u5c06\u4e24\u4e2a\u5b57\u7b26\u4e32\u8fde\u63a5\u8d77\u6765\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u7efc\u5408\u5e94\u7528\u5b9e\u4f8b<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u524d\u9762\u4ecb\u7ecd\u7684\u5404\u79cd\u65b9\u6cd5\uff0c\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u7efc\u5408\u5e94\u7528\u5b9e\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5728\u4e00\u4e2a\u6570\u636e\u5904\u7406\u4efb\u52a1\u4e2d\u7ed3\u5408\u4f7f\u7528\u8fd9\u4e9b\u6280\u672f\u3002<\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u4ea7\u54c1\u548c\u5176\u9500\u552e\u6570\u636e\u7684\u5b57\u5178\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u6240\u6709\u4ea7\u54c1\u7684\u603b\u9500\u552e\u989d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">sales_data = {<\/p>\n<p>    &#39;product1&#39;: [100, 200, 300],<\/p>\n<p>    &#39;product2&#39;: [150, 250, 350],<\/p>\n<p>    &#39;product3&#39;: [200, 300, 400]<\/p>\n<p>}<\/p>\n<p>total_sales = sum([sum(sales) for sales in sales_data.values()])<\/p>\n<p>print(f&quot;Total sales: {total_sales}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u904d\u5386\u5b57\u5178\u4e2d\u7684\u6bcf\u4e2a\u5217\u8868\uff0c\u5e76\u5bf9\u6bcf\u4e2a\u5217\u8868\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u8fdb\u884c\u6c42\u548c\uff0c\u6700\u7ec8\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u5bf9\u6240\u6709\u4ea7\u54c1\u7684\u9500\u552e\u989d\u8fdb\u884c\u6c47\u603b\u3002<\/p>\n<\/p>\n<p><p>\u4ee5\u4e0a\u5c31\u662f\u5728Python\u4e2d\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u7684\u51e0\u79cd\u5e38\u89c1\u65b9\u6cd5\u548c\u6280\u5de7\u3002\u6839\u636e\u5177\u4f53\u7684\u6570\u636e\u7c7b\u578b\u548c\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u76f8\u52a0\u64cd\u4f5c\u3002\u5bf9\u4e8e\u7b80\u5355\u7684\u6570\u503c\u7c7b\u578b\uff0c\u76f4\u63a5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\u662f\u6700\u7b80\u5355\u7684\uff1b\u800c\u5bf9\u4e8e\u590d\u6742\u7684\u6570\u636e\u7ed3\u6784\uff0c<code>numpy<\/code>\u5e93\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\u6765\u5904\u7406\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u53ef\u4ee5\u6709\u6548\u5730\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\u7684\u76ee\u6807\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u4e24\u4e2a\u6570\u5b57\u7684\u76f8\u52a0\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u7b80\u5355\u7684\u52a0\u6cd5\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u201c+\u201d\u8fd0\u7b97\u7b26\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u5c06\u4e24\u4e2a\u6570\u5b57\u76f8\u52a0\uff1a  <\/p>\n<pre><code class=\"language-python\">a = 5\nb = 3\nresult = a + b\nprint(result)  # \u8f93\u51fa 8\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u975e\u5e38\u76f4\u89c2\u4e14\u6613\u4e8e\u4f7f\u7528\uff0c\u4f60\u53ea\u9700\u786e\u4fdd\u4e24\u8005\u90fd\u662f\u6570\u5b57\u7c7b\u578b\u5373\u53ef\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\uff0c\u5982\u4f55\u5bf9\u5217\u8868\u4e2d\u7684\u6240\u6709\u5143\u7d20\u8fdb\u884c\u6c42\u548c\uff1f<\/strong><br \/>\u8981\u5bf9\u4e00\u4e2a\u5217\u8868\u4e2d\u7684\u6240\u6709\u5143\u7d20\u8fdb\u884c\u6c42\u548c\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>sum()<\/code>\u51fd\u6570\u3002\u8fd9\u4e2a\u51fd\u6570\u4f1a\u904d\u5386\u5217\u8868\u5e76\u8fd4\u56de\u6240\u6709\u5143\u7d20\u7684\u603b\u548c\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">numbers = [1, 2, 3, 4, 5]\ntotal = sum(numbers)\nprint(total)  # \u8f93\u51fa 15\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u9ad8\u6548\uff0c\u9002\u5408\u5904\u7406\u4efb\u610f\u6570\u91cf\u7684\u5143\u7d20\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5904\u7406\u5b57\u7b26\u4e32\u76f8\u52a0\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5b57\u7b26\u4e32\u7684\u76f8\u52a0\u4e5f\u79f0\u4e3a\u5b57\u7b26\u4e32\u7684\u8fde\u63a5\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u201c+\u201d\u8fd0\u7b97\u7b26\u5c06\u4e24\u4e2a\u5b57\u7b26\u4e32\u8fde\u63a5\u5728\u4e00\u8d77\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">str1 = &quot;Hello, &quot;\nstr2 = &quot;World!&quot;\nresult = str1 + str2\nprint(result)  # \u8f93\u51fa &quot;Hello, World!&quot;\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u4f7f\u5f97\u5b57\u7b26\u4e32\u5904\u7406\u53d8\u5f97\u7b80\u5355\u76f4\u89c2\uff0c\u9002\u5408\u4e8e\u9700\u8981\u62fc\u63a5\u6587\u672c\u7684\u573a\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5b9e\u73b0\u6570\u636e\u76f8\u52a0\uff0c\u53ef\u4ee5\u4f7f\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\uff08+\uff09\u3001sum()\u51fd\u6570\u3001\u5217\u8868\u63a8\u5bfc\u3001numpy\u5e93\u7b49\u65b9\u6cd5\u3002\u9996\u5148\uff0c [&hellip;]","protected":false},"author":3,"featured_media":1014171,"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\/1014162"}],"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=1014162"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1014162\/revisions"}],"predecessor-version":[{"id":1014172,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1014162\/revisions\/1014172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1014171"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1014162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1014162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1014162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}