{"id":961201,"date":"2024-12-27T03:56:36","date_gmt":"2024-12-26T19:56:36","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/961201.html"},"modified":"2024-12-27T03:56:38","modified_gmt":"2024-12-26T19:56:38","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8int","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/961201.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u4f7f\u7528int"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25103501\/f8d319b9-00e7-46b2-975f-0a8c52ef4a68.webp\" alt=\"python\u4e2d\u5982\u4f55\u4f7f\u7528int\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c<strong>\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u5c06\u5176\u4ed6\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u4e3a\u6574\u6570\u3001\u5904\u7406\u7528\u6237\u8f93\u5165\u3001\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\u3001\u63a7\u5236\u5faa\u73af\u6b21\u6570<\/strong>\u3002\u9996\u5148\uff0c<code>int()<\/code>\u51fd\u6570\u662fPython\u5185\u7f6e\u7684\u51fd\u6570\uff0c\u7528\u4e8e\u5c06\u4e00\u4e2a\u6570\u5b57\u6216\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u7c7b\u578b\u3002\u5176\u4f7f\u7528\u975e\u5e38\u7b80\u5355\u4e14\u5728\u6570\u636e\u5904\u7406\u3001\u7b97\u6cd5\u5b9e\u73b0\u4e2d\u6781\u4e3a\u5e38\u89c1\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u8bb2\u8ff0\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528<code>int()<\/code>\u53ca\u5176\u76f8\u5173\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001<code>INT()<\/code>\u51fd\u6570\u7684\u57fa\u672c\u7528\u6cd5<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c<code>int()<\/code>\u51fd\u6570\u662f\u4e00\u4e2a\u7528\u4e8e\u5c06\u5176\u4ed6\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u4e3a\u6574\u6570\u7c7b\u578b\u7684\u5185\u7f6e\u51fd\u6570\u3002\u5176\u57fa\u672c\u8bed\u6cd5\u4e3a<code>int(x, base=10)<\/code>\uff0c\u5176\u4e2d<code>x<\/code>\u662f\u8981\u8f6c\u6362\u4e3a\u6574\u6570\u7684\u5bf9\u8c61\uff0c<code>base<\/code>\u662f\u8fdb\u5236\uff0c\u9ed8\u8ba4\u4e3a10\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u7528\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570<\/strong><\/p>\n<\/p>\n<p><p>\u5f53\u9700\u8981\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570\u65f6\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u79cd\u8f6c\u6362\u4f1a\u622a\u65ad\u5c0f\u6570\u90e8\u5206\uff0c\u800c\u4e0d\u662f\u56db\u820d\u4e94\u5165\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">float_number = 3.14<\/p>\n<p>integer_number = int(float_number)  # \u7ed3\u679c\u4e3a3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570<\/strong><\/p>\n<\/p>\n<p><p><code>int()<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u8868\u793a\u6574\u6570\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u7c7b\u578b\u3002\u5b57\u7b26\u4e32\u4e2d\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\u6216\u5176\u4ed6\u975e\u6570\u5b57\u5b57\u7b26\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">str_number = &quot;42&quot;<\/p>\n<p>integer_number = int(str_number)  # \u7ed3\u679c\u4e3a42<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u7528\u6237\u8f93\u5165<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u7528\u6237\u8f93\u5165\u901a\u5e38\u662f\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u82e5\u9700\u8981\u8fdb\u884c\u6570\u503c\u8fd0\u7b97\uff0c\u5fc5\u987b\u5c06\u5176\u8f6c\u6362\u4e3a\u6574\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;Enter a number: &quot;)<\/p>\n<p>integer_input = int(user_input)  # \u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001<code>INT()<\/code>\u51fd\u6570\u7684\u9ad8\u7ea7\u5e94\u7528<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8fdb\u5236\u8f6c\u6362<\/strong><\/p>\n<\/p>\n<p><p><code>int()<\/code>\u51fd\u6570\u652f\u6301\u8fdb\u5236\u8f6c\u6362\uff0c\u901a\u8fc7\u6307\u5b9a<code>base<\/code>\u53c2\u6570\uff0c\u53ef\u4ee5\u5c06\u5176\u4ed6\u8fdb\u5236\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5341\u8fdb\u5236\u6574\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">binary_str = &quot;1010&quot;<\/p>\n<p>decimal_number = int(binary_str, 2)  # \u7ed3\u679c\u4e3a10<\/p>\n<p>hex_str = &quot;A&quot;<\/p>\n<p>decimal_number = int(hex_str, 16)  # \u7ed3\u679c\u4e3a10<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u5f02\u5e38<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c<code>int()<\/code>\u51fd\u6570\u53ef\u80fd\u4f1a\u56e0\u4e3a\u8f93\u5165\u4e0d\u5408\u6cd5\u800c\u5f15\u53d1<code>ValueError<\/code>\u5f02\u5e38\u3002\u56e0\u6b64\uff0c\u901a\u5e38\u5728\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u65f6\uff0c\u7ed3\u5408<code>try-except<\/code>\u7ed3\u6784\u6765\u6355\u83b7\u5f02\u5e38\uff0c\u4fdd\u8bc1\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    user_input = input(&quot;Enter a number: &quot;)<\/p>\n<p>    integer_input = int(user_input)<\/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<\/li>\n<li>\n<p><strong>\u6570\u5b66\u8fd0\u7b97<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6574\u6570\u7c7b\u578b\u662f\u7528\u4e8e\u6570\u5b66\u8fd0\u7b97\u7684\u57fa\u7840\u7c7b\u578b\u4e4b\u4e00\u3002\u901a\u8fc7<code>int()<\/code>\u51fd\u6570\uff0c\u5c06\u5176\u4ed6\u7c7b\u578b\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u6574\u6570\u540e\uff0c\u53ef\u4ee5\u8fdb\u884c\u5404\u79cd\u6570\u5b66\u8fd0\u7b97\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">a = int(&quot;5&quot;)<\/p>\n<p>b = int(&quot;10&quot;)<\/p>\n<p>sum_ab = a + b  # \u7ed3\u679c\u4e3a15<\/p>\n<p>product_ab = a * b  # \u7ed3\u679c\u4e3a50<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001<code>INT()<\/code>\u51fd\u6570\u7684\u6027\u80fd\u548c\u9650\u5236<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6027\u80fd\u4f18\u52bf<\/strong><\/p>\n<\/p>\n<p><p>Python\u7684<code>int()<\/code>\u51fd\u6570\u662f\u9ad8\u5ea6\u4f18\u5316\u7684\uff0c\u80fd\u591f\u5feb\u901f\u8fdb\u884c\u7c7b\u578b\u8f6c\u6362\u3002\u5728\u5904\u7406\u5927\u91cf\u6570\u636e\u6216\u8fdb\u884c\u6570\u503c\u8fd0\u7b97\u65f6\uff0c<code>int()<\/code>\u51fd\u6570\u7684\u6027\u80fd\u8868\u73b0\u826f\u597d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9650\u5236\u548c\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u622a\u65ad\u95ee\u9898<\/strong>\uff1a<code>int()<\/code>\u51fd\u6570\u5728\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570\u65f6\uff0c\u4ec5\u622a\u53d6\u6574\u6570\u90e8\u5206\uff0c\u4e0d\u8fdb\u884c\u56db\u820d\u4e94\u5165\u3002<\/li>\n<li><strong>\u5b57\u7b26\u4e32\u9650\u5236<\/strong>\uff1a\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u5fc5\u987b\u662f\u6709\u6548\u7684\u6570\u503c\u8868\u793a\uff0c\u4e0d\u80fd\u5305\u542b\u7a7a\u683c\u6216\u5176\u4ed6\u975e\u6570\u5b57\u5b57\u7b26\u3002<\/li>\n<li><strong>\u8fdb\u5236\u8303\u56f4<\/strong>\uff1a<code>int()<\/code>\u51fd\u6570\u652f\u6301\u4ece2\u523036\u7684\u8fdb\u5236\u8f6c\u6362\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001<code>INT()<\/code>\u51fd\u6570\u7684\u5b9e\u9645\u6848\u4f8b\u5206\u6790<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u6e05\u6d17<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u5c06\u5b57\u7b26\u4e32\u6570\u636e\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u4f8b\u5982\uff0c\u5904\u7406CSV\u6587\u4ef6\u4e2d\u7684\u6570\u503c\u6570\u636e\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>int()<\/code>\u51fd\u6570\u5c06\u5176\u8f6c\u6362\u4e3a\u6574\u6570\u7c7b\u578b\uff0c\u4ee5\u4fbf\u8fdb\u884c\u8fdb\u4e00\u6b65\u5206\u6790\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data = [&quot;23&quot;, &quot;45&quot;, &quot;67&quot;, &quot;89&quot;]<\/p>\n<p>cleaned_data = [int(item) for item in data]  # \u8f6c\u6362\u4e3a\u6574\u6570\u5217\u8868<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5faa\u73af\u63a7\u5236<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5faa\u73af\u63a7\u5236\u4e2d\uff0c<code>int()<\/code>\u51fd\u6570\u5e38\u7528\u4e8e\u786e\u5b9a\u5faa\u73af\u6b21\u6570\u3002\u4f8b\u5982\uff0c\u4ece\u7528\u6237\u8f93\u5165\u4e2d\u83b7\u53d6\u5faa\u73af\u6b21\u6570\uff0c\u5e76\u786e\u4fdd\u8f93\u5165\u4e3a\u6574\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">user_input = input(&quot;Enter the number of iterations: &quot;)<\/p>\n<p>try:<\/p>\n<p>    iterations = int(user_input)<\/p>\n<p>    for i in range(iterations):<\/p>\n<p>        print(f&quot;Iteration {i + 1}&quot;)<\/p>\n<p>except ValueError:<\/p>\n<p>    print(&quot;Please enter a valid integer.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7b97\u6cd5\u5b9e\u73b0<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7b97\u6cd5\u5b9e\u73b0\u4e2d\uff0c\u6574\u6570\u7c7b\u578b\u662f\u57fa\u7840\u7684\u6570\u636e\u7c7b\u578b\uff0c\u901a\u8fc7<code>int()<\/code>\u51fd\u6570\uff0c\u786e\u4fdd\u8f93\u5165\u6570\u636e\u7684\u6b63\u786e\u6027\u3002\u4f8b\u5982\uff0c\u5728\u5b9e\u73b0\u6392\u5e8f\u7b97\u6cd5\u65f6\uff0c\u901a\u5e38\u9700\u8981\u5904\u7406\u6574\u6570\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def bubble_sort(arr):<\/p>\n<p>    n = len(arr)<\/p>\n<p>    for i in range(n):<\/p>\n<p>        for j in range(0, n-i-1):<\/p>\n<p>            if arr[j] &gt; arr[j+1]:<\/p>\n<p>                arr[j], arr[j+1] = arr[j+1], arr[j]<\/p>\n<p>data = [&quot;5&quot;, &quot;3&quot;, &quot;8&quot;, &quot;6&quot;, &quot;2&quot;]<\/p>\n<p>int_data = [int(x) for x in data]<\/p>\n<p>bubble_sort(int_data)<\/p>\n<p>print(&quot;Sorted array is:&quot;, int_data)  # \u8f93\u51fa: [2, 3, 5, 6, 8]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001<code>INT()<\/code>\u51fd\u6570\u5728\u4e0d\u540cPython\u7248\u672c\u4e2d\u7684\u53d8\u5316<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python 2\u4e0ePython 3\u7684\u5dee\u5f02<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python 2\u4e2d\uff0c<code>int()<\/code>\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u666e\u901a\u6574\u6570\u7c7b\u578b\uff08<code>int<\/code>\uff09\uff0c\u800c\u5728Python 3\u4e2d\uff0c<code>int()<\/code>\u8fd4\u56de\u4e00\u4e2a\u957f\u6574\u6570\u7c7b\u578b\uff08<code>long<\/code>\uff09\u3002\u4f46\u662f\uff0cPython 3\u53d6\u6d88\u4e86<code>long<\/code>\u7c7b\u578b\uff0c\u6240\u6709\u6574\u6570\u90fd\u662f<code>int<\/code>\u7c7b\u578b\uff0c\u5e76\u4e14\u53ef\u4ee5\u8868\u793a\u66f4\u5927\u7684\u6570\u503c\u8303\u56f4\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u529f\u80fd\u4e00\u81f4\u6027<\/strong><\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u662fPython 2\u8fd8\u662fPython 3\uff0c<code>int()<\/code>\u51fd\u6570\u7684\u57fa\u672c\u529f\u80fd\u548c\u7528\u6cd5\u57fa\u672c\u4e00\u81f4\uff0c\u53ea\u662f\u5728\u8868\u73b0\u5f62\u5f0f\u4e0a\u6709\u6240\u4e0d\u540c\u3002Python 3\u5728\u7c7b\u578b\u5904\u7406\u4e0a\u66f4\u52a0\u7edf\u4e00\uff0c\u53bb\u9664\u4e86<code>long<\/code>\u7c7b\u578b\uff0c\u4f7f\u5f97<code>int()<\/code>\u51fd\u6570\u7684\u4f7f\u7528\u66f4\u52a0\u7b80\u5355\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0cPython\u4e2d\u7684<code>int()<\/code>\u51fd\u6570\u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u5de5\u5177\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5404\u79cd\u6570\u636e\u5904\u7406\u548c\u7b97\u6cd5\u5b9e\u73b0\u4e2d\u3002\u901a\u8fc7\u5bf9<code>int()<\/code>\u51fd\u6570\u7684\u6df1\u5165\u7406\u89e3\u548c\u7075\u6d3b\u5e94\u7528\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u548c\u6027\u80fd\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\uff0c\u90fd\u5e94\u719f\u7ec3\u638c\u63e1<code>int()<\/code>\u51fd\u6570\u7684\u4f7f\u7528\u6280\u5de7\uff0c\u4ee5\u4fbf\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5f97\u5fc3\u5e94\u624b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>int()<\/code>\u51fd\u6570\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6574\u6570\u3002\u53ea\u9700\u5c06\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9<code>int()<\/code>\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u5b57\u7b26\u4e32<code>&quot;123&quot;<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528<code>int(&quot;123&quot;)<\/code>\u6765\u83b7\u53d6\u6574\u6570123\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5b57\u7b26\u4e32\u5305\u542b\u975e\u6570\u5b57\u5b57\u7b26\uff0c\u8f6c\u6362\u5c06\u4f1a\u5f15\u53d1<code>ValueError<\/code>\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\uff0cint\u7c7b\u578b\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c\u662f\u591a\u5c11\uff1f<\/strong><br \/>Python\u4e2d\u7684\u6574\u6570\u7c7b\u578b\uff08<code>int<\/code>\uff09\u5e76\u6ca1\u6709\u56fa\u5b9a\u7684\u6700\u5927\u503c\u6216\u6700\u5c0f\u503c\uff0c\u56e0\u4e3a\u5b83\u7684\u5927\u5c0f\u662f\u52a8\u6001\u7684\uff0c\u53d6\u51b3\u4e8e\u53ef\u7528\u7684\u5185\u5b58\u3002Python\u4f1a\u6839\u636e\u9700\u8981\u81ea\u52a8\u8c03\u6574\u6574\u6570\u7684\u5b58\u50a8\u5927\u5c0f\uff0c\u56e0\u6b64\u4f60\u53ef\u4ee5\u5904\u7406\u975e\u5e38\u5927\u7684\u6574\u6570\u800c\u4e0d\u5fc5\u62c5\u5fc3\u6ea2\u51fa\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528int\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c<code>int<\/code>\u7c7b\u578b\u53ef\u4ee5\u4e0e\u5176\u4ed6\u6570\u5b57\u7c7b\u578b\uff08\u5982\u6d6e\u70b9\u6570\uff09\u8fdb\u884c\u5404\u79cd\u6570\u5b66\u8fd0\u7b97\uff0c\u5305\u62ec\u52a0\u6cd5\u3001\u51cf\u6cd5\u3001\u4e58\u6cd5\u548c\u9664\u6cd5\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u6267\u884c<code>a + b<\/code>\u3001<code>a - b<\/code>\u3001<code>a * b<\/code>\u4ee5\u53ca<code>a \/ b<\/code>\u7b49\u64cd\u4f5c\u3002Python\u4f1a\u6839\u636e\u64cd\u4f5c\u6570\u7684\u7c7b\u578b\u81ea\u52a8\u5904\u7406\u7ed3\u679c\u7684\u6570\u636e\u7c7b\u578b\uff0c\u786e\u4fdd\u8ba1\u7b97\u7684\u51c6\u786e\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u4f7f\u7528int()\u51fd\u6570\u5c06\u5176\u4ed6\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u4e3a\u6574\u6570\u3001\u5904\u7406\u7528\u6237\u8f93\u5165\u3001\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\u3001\u63a7\u5236\u5faa\u73af\u6b21\u6570\u3002\u9996\u5148\uff0c [&hellip;]","protected":false},"author":3,"featured_media":961210,"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\/961201"}],"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=961201"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/961201\/revisions"}],"predecessor-version":[{"id":961212,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/961201\/revisions\/961212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/961210"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=961201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=961201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=961201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}