{"id":1071742,"date":"2025-01-08T11:09:57","date_gmt":"2025-01-08T03:09:57","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1071742.html"},"modified":"2025-01-08T11:10:00","modified_gmt":"2025-01-08T03:10:00","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e8%be%93%e5%87%ba%e4%b8%89%e4%bd%8d%e5%b0%8f%e6%95%b0-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1071742.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25102153\/0cd0c210-3432-4b86-a382-c8e2c7a6fa9d.webp\" alt=\"python\u4e2d\u5982\u4f55\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001\u4f7f\u7528format()\u51fd\u6570\u3001\u4f7f\u7528round()\u51fd\u6570\u3002<\/strong>\u5176\u4e2d\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u662f\u6700\u5e38\u89c1\u4e14\u7075\u6d3b\u7684\u65b9\u6cd5\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u51e0\u79cd\u65b9\u6cd5\uff0c\u5e76\u63a2\u8ba8\u5b83\u4eec\u7684\u5e94\u7528\u573a\u666f\u548c\u4f18\u7f3a\u70b9\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/h3>\n<\/p>\n<p><p>\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u662fPython\u4e2d\u5e38\u7528\u7684\u4e00\u79cd\u8f93\u51fa\u683c\u5f0f\u65b9\u6cd5\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u63a7\u5236\u5c0f\u6570\u70b9\u4f4d\u6570\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u6574\u6570\u3001\u5b57\u7b26\u4e32\u7b49\u8fdb\u884c\u683c\u5f0f\u5316\u3002\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff1a\u767e\u5206\u53f7\uff08%\uff09\u683c\u5f0f\u5316\u548cf-string\u683c\u5f0f\u5316\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u767e\u5206\u53f7\uff08%\uff09\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p>\u767e\u5206\u53f7\u683c\u5f0f\u5316\u662fPython\u4e2d\u8f83\u4e3a\u4f20\u7edf\u7684\u4e00\u79cd\u683c\u5f0f\u5316\u65b9\u6cd5\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">number = 3.1415926<\/p>\n<p>formatted_number = &quot;%.3f&quot; % number<\/p>\n<p>print(formatted_number)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c<code>&quot;%.3f&quot;<\/code>\u8868\u793a\u5c06\u6570\u5b57\u683c\u5f0f\u5316\u4e3a\u4e09\u4f4d\u5c0f\u6570\u7684\u6d6e\u70b9\u6570\u3002<code>%<\/code>\u662f\u683c\u5f0f\u5316\u64cd\u4f5c\u7b26\uff0c<code>f<\/code>\u8868\u793a\u6d6e\u70b9\u6570\uff0c<code>.3<\/code>\u8868\u793a\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u3002<\/p>\n<\/p>\n<p><h4>2\u3001f-string\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p>f-string\u683c\u5f0f\u5316\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u65b0\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\u3002\u5b83\u6bd4\u767e\u5206\u53f7\u683c\u5f0f\u5316\u66f4\u52a0\u7b80\u6d01\u6613\u8bfb\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">number = 3.1415926<\/p>\n<p>formatted_number = f&quot;{number:.3f}&quot;<\/p>\n<p>print(formatted_number)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c<code>f&quot;{number:.3f}&quot;<\/code>\u8868\u793a\u5c06\u6570\u5b57\u683c\u5f0f\u5316\u4e3a\u4e09\u4f4d\u5c0f\u6570\u7684\u6d6e\u70b9\u6570\u3002<code>f<\/code>\u662f\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u7684\u524d\u7f00\uff0c<code>{}<\/code>\u5185\u662f\u8981\u683c\u5f0f\u5316\u7684\u53d8\u91cf\uff0c<code>:.3f<\/code>\u8868\u793a\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001format()\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\uff0cPython\u8fd8\u63d0\u4f9b\u4e86<code>format()<\/code>\u51fd\u6570\u6765\u8fdb\u884c\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">number = 3.1415926<\/p>\n<p>formatted_number = &quot;{:.3f}&quot;.format(number)<\/p>\n<p>print(formatted_number)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c<code>&quot;{:.3f}&quot;.format(number)<\/code>\u8868\u793a\u5c06\u6570\u5b57\u683c\u5f0f\u5316\u4e3a\u4e09\u4f4d\u5c0f\u6570\u7684\u6d6e\u70b9\u6570\u3002<code>{}<\/code>\u5185\u662f\u683c\u5f0f\u5316\u8bf4\u660e\u7b26\uff0c<code>:.3f<\/code>\u8868\u793a\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001round()\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>round()<\/code>\u51fd\u6570\u7528\u4e8e\u5bf9\u6570\u5b57\u8fdb\u884c\u56db\u820d\u4e94\u5165\u3002\u867d\u7136\u5b83\u4e0d\u80fd\u76f4\u63a5\u63a7\u5236\u8f93\u51fa\u683c\u5f0f\uff0c\u4f46\u53ef\u4ee5\u7528\u6765\u5bf9\u6570\u5b57\u8fdb\u884c\u5904\u7406\uff0c\u518d\u901a\u8fc7\u5176\u4ed6\u65b9\u6cd5\u8f93\u51fa\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">number = 3.1415926<\/p>\n<p>rounded_number = round(number, 3)<\/p>\n<p>print(rounded_number)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c<code>round(number, 3)<\/code>\u8868\u793a\u5c06\u6570\u5b57\u56db\u820d\u4e94\u5165\u5230\u4e09\u4f4d\u5c0f\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5e94\u7528\u573a\u666f\u548c\u4f18\u7f3a\u70b9<\/h3>\n<\/p>\n<p><h4>1\u3001\u767e\u5206\u53f7\uff08%\uff09\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong> \u4f20\u7edf\u65b9\u6cd5\uff0c\u517c\u5bb9\u6027\u597d\uff1b<br \/><strong>\u7f3a\u70b9\uff1a<\/strong> \u8bed\u6cd5\u8f83\u4e3a\u7e41\u7410\uff0c\u4e0d\u6613\u8bfb\uff1b<\/p>\n<\/p>\n<p><h4>2\u3001f-string\u683c\u5f0f\u5316<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong> \u8bed\u6cd5\u7b80\u6d01\uff0c\u6613\u8bfb\u6613\u5199\uff1b<br \/><strong>\u7f3a\u70b9\uff1a<\/strong> \u4ec5\u652f\u6301Python 3.6\u53ca\u4ee5\u4e0a\u7248\u672c\uff1b<\/p>\n<\/p>\n<p><h4>3\u3001format()\u51fd\u6570<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong> \u529f\u80fd\u5f3a\u5927\uff0c\u652f\u6301\u591a\u79cd\u683c\u5f0f\u5316\u64cd\u4f5c\uff1b<br \/><strong>\u7f3a\u70b9\uff1a<\/strong> \u8bed\u6cd5\u8f83\u4e3a\u7e41\u7410\uff1b<\/p>\n<\/p>\n<p><h4>4\u3001round()\u51fd\u6570<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong> \u7b80\u5355\u6613\u7528\uff0c\u9002\u7528\u4e8e\u9700\u8981\u56db\u820d\u4e94\u5165\u7684\u573a\u666f\uff1b<br \/><strong>\u7f3a\u70b9\uff1a<\/strong> \u4e0d\u80fd\u76f4\u63a5\u63a7\u5236\u8f93\u51fa\u683c\u5f0f\uff1b<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5b9e\u9645\u5e94\u7528\u793a\u4f8b<\/h3>\n<\/p>\n<p><h4>1\u3001\u6570\u636e\u5904\u7406\u548c\u5206\u6790<\/h4>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u5bf9\u6d6e\u70b9\u6570\u8fdb\u884c\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u4f8b\u5982\uff0c\u5728\u7edf\u8ba1\u5206\u6790\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u8f93\u51fa\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u7684\u5e73\u5747\u503c\u3001\u6807\u51c6\u5dee\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>data = [1.23, 2.34, 3.45, 4.56, 5.67]<\/p>\n<p>mean = np.mean(data)<\/p>\n<p>std_dev = np.std(data)<\/p>\n<p>print(f&quot;Mean: {mean:.3f}, Standard Deviation: {std_dev:.3f}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528f-string\u683c\u5f0f\u5316\u8f93\u51fa\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u7684\u5e73\u5747\u503c\u548c\u6807\u51c6\u5dee\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u91d1\u878d\u548c\u4f1a\u8ba1<\/h4>\n<\/p>\n<p><p>\u5728\u91d1\u878d\u548c\u4f1a\u8ba1\u9886\u57df\uff0c\u7ecf\u5e38\u9700\u8981\u5bf9\u8d27\u5e01\u91d1\u989d\u8fdb\u884c\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u4f8b\u5982\uff0c\u5728\u751f\u6210\u8d22\u52a1\u62a5\u8868\u65f6\uff0c\u9700\u8981\u4fdd\u7559\u5c0f\u6570\u70b9\u540e\u4e09\u4f4d\u7684\u91d1\u989d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">amount = 12345.6789<\/p>\n<p>formatted_amount = &quot;${:,.3f}&quot;.format(amount)<\/p>\n<p>print(formatted_amount)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528<code>format()<\/code>\u51fd\u6570\u683c\u5f0f\u5316\u8f93\u51fa\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u5e76\u5e26\u6709\u5343\u4f4d\u5206\u9694\u7b26\u7684\u8d27\u5e01\u91d1\u989d\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u79d1\u5b66\u8ba1\u7b97\u548c\u5de5\u7a0b<\/h4>\n<\/p>\n<p><p>\u5728\u79d1\u5b66\u8ba1\u7b97\u548c\u5de5\u7a0b\u9886\u57df\uff0c\u7ecf\u5e38\u9700\u8981\u5bf9\u8ba1\u7b97\u7ed3\u679c\u8fdb\u884c\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u4f8b\u5982\uff0c\u5728\u8ba1\u7b97\u7269\u7406\u91cf\u65f6\uff0c\u9700\u8981\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u7684\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">distance = 12345.6789<\/p>\n<p>formatted_distance = f&quot;{distance:.3f} meters&quot;<\/p>\n<p>print(formatted_distance)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528f-string\u683c\u5f0f\u5316\u8f93\u51fa\u4fdd\u7559\u4e09\u4f4d\u5c0f\u6570\u7684\u8ddd\u79bb\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001\u4f7f\u7528<code>format()<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>round()<\/code>\u51fd\u6570\u3002\u5176\u4e2d\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u662f\u6700\u5e38\u89c1\u4e14\u7075\u6d3b\u7684\u65b9\u6cd5\u3002\u6839\u636e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\uff0c\u53ef\u4ee5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u8fdb\u884c\u683c\u5f0f\u5316\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><p><strong>\u767e\u5206\u53f7\uff08%\uff09\u683c\u5f0f\u5316<\/strong>\u9002\u7528\u4e8e\u4f20\u7edf\u65b9\u6cd5\uff0c\u5177\u6709\u8f83\u597d\u7684\u517c\u5bb9\u6027\uff0c\u4f46\u8bed\u6cd5\u8f83\u4e3a\u7e41\u7410\u3002<strong>f-string\u683c\u5f0f\u5316<\/strong>\u9002\u7528\u4e8ePython 3.6\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u8bed\u6cd5\u7b80\u6d01\u6613\u8bfb\u3002<strong>format()\u51fd\u6570<\/strong>\u529f\u80fd\u5f3a\u5927\uff0c\u652f\u6301\u591a\u79cd\u683c\u5f0f\u5316\u64cd\u4f5c\uff0c\u4f46\u8bed\u6cd5\u8f83\u4e3a\u7e41\u7410\u3002<strong>round()\u51fd\u6570<\/strong>\u9002\u7528\u4e8e\u9700\u8981\u56db\u820d\u4e94\u5165\u7684\u573a\u666f\uff0c\u4f46\u4e0d\u80fd\u76f4\u63a5\u63a7\u5236\u8f93\u51fa\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u8fdb\u884c\u683c\u5f0f\u5316\u8f93\u51fa\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u540c\u65f6\uff0c\u6ce8\u610f\u4ee3\u7801\u7684\u517c\u5bb9\u6027\u548c\u8fd0\u884c\u73af\u5883\uff0c\u786e\u4fdd\u4ee3\u7801\u5728\u4e0d\u540c\u7248\u672c\u7684Python\u4e2d\u90fd\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u683c\u5f0f\u5316\u6570\u5b57\u4ee5\u663e\u793a\u4e09\u4f4d\u5c0f\u6570\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u6765\u63a7\u5236\u6570\u5b57\u7684\u8f93\u51fa\u683c\u5f0f\u3002\u4f7f\u7528<code>f-string<\/code>\uff08Python 3.6\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c<code>value = 3.14159<\/code>\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>formatted_value = f&quot;{value:.3f}&quot;<\/code>\u6765\u5c06\u5176\u683c\u5f0f\u5316\u4e3a\u4e09\u4f4d\u5c0f\u6570\uff0c\u7ed3\u679c\u662f<code>3.142<\/code>\u3002\u53e6\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>format()<\/code>\u51fd\u6570\uff0c\u50cf\u8fd9\u6837\uff1a<code>formatted_value = &quot;{:.3f}&quot;.format(value)<\/code>\uff0c\u6548\u679c\u76f8\u540c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406\u6d6e\u70b9\u6570\u7684\u7cbe\u5ea6\u95ee\u9898\uff1f<\/strong><br \/>\u6d6e\u70b9\u6570\u5728\u8ba1\u7b97\u65f6\u53ef\u80fd\u4f1a\u51fa\u73b0\u7cbe\u5ea6\u95ee\u9898\u3002\u4e3a\u4e86\u4fdd\u6301\u4e09\u4f4d\u5c0f\u6570\u7684\u51c6\u786e\u6027\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>round()<\/code>\u51fd\u6570\u6765\u5904\u7406\u3002\u4f8b\u5982\uff0c<code>rounded_value = round(value, 3)<\/code>\u5c06\u4f1a\u628a<code>value<\/code>\u56db\u820d\u4e94\u5165\u5230\u4e09\u4f4d\u5c0f\u6570\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u4f7f\u7528<code>round()<\/code>\u65f6\uff0c\u5982\u679c\u60a8\u9700\u8981\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\u8f93\u51fa\uff0c\u53ef\u4ee5\u7ed3\u5408\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u5c06\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570\u7684\u8bbe\u7f6e\u5e94\u7528\u4e8e\u6570\u636e\u6846\u4e2d\u7684\u5217\uff1f<\/strong><br \/>\u5982\u679c\u60a8\u5728\u4f7f\u7528Pandas\u5e93\u5904\u7406\u6570\u636e\u6846\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<code>pd.options.display.float_format<\/code>\u6765\u7edf\u4e00\u683c\u5f0f\u5316\u6240\u6709\u6d6e\u70b9\u6570\u7684\u8f93\u51fa\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>pd.options.display.float_format = &#39;{:.3f}&#39;.format<\/code>\u6765\u786e\u4fdd\u6570\u636e\u6846\u4e2d\u6240\u6709\u6d6e\u70b9\u6570\u90fd\u663e\u793a\u4e3a\u4e09\u4f4d\u5c0f\u6570\u3002\u8fd9\u5bf9\u4e8e\u6570\u636e\u5206\u6790\u548c\u62a5\u544a\u975e\u5e38\u6709\u7528\uff0c\u56e0\u4e3a\u5b83\u80fd\u4f7f\u7ed3\u679c\u66f4\u52a0\u6574\u6d01\u4e14\u6613\u4e8e\u7406\u89e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u8f93\u51fa\u4e09\u4f4d\u5c0f\u6570\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001\u4f7f\u7528format()\u51fd\u6570\u3001\u4f7f\u7528round()\u51fd\u6570 [&hellip;]","protected":false},"author":3,"featured_media":1071748,"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\/1071742"}],"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=1071742"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071742\/revisions"}],"predecessor-version":[{"id":1071750,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1071742\/revisions\/1071750"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1071748"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1071742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1071742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1071742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}