File size: 5,042 Bytes
41ad9d7 |
1 |
[[null, "<p>\u6b22\u8fce\u4f7f\u7528 \u5f20\u5e73\u7684\u4e13\u5c5e\u77e5\u8bc6\u5e93\uff01</p></p>\n<p>\u8bf7\u5728\u53f3\u4fa7\u5207\u6362\u6a21\u5f0f\uff0c\u76ee\u524d\u652f\u6301\u76f4\u63a5\u4e0e LLM \u6a21\u578b\u5bf9\u8bdd\u6216\u57fa\u4e8e\u672c\u5730\u77e5\u8bc6\u5e93\u95ee\u7b54\u3002\n\u77e5\u8bc6\u5e93\u95ee\u7b54\u6a21\u5f0f\uff0c\u9009\u62e9\u77e5\u8bc6\u5e93\u540d\u79f0\u540e\uff0c\u5373\u53ef\u5f00\u59cb\u95ee\u7b54\uff0c\u5982\u6709\u9700\u8981\u53ef\u4ee5\u4e0a\u4f20\u6587\u4ef6/\u6587\u4ef6\u5939\u81f3\u77e5\u8bc6\u5e93\u3002\n\u77e5\u8bc6\u5e93\u6682\u4e0d\u652f\u6301\u6587\u4ef6\u5220\u9664\u3002"], [null, "\u6a21\u578b\u5df2\u6210\u529f\u52a0\u8f7d\uff0c\u53ef\u4ee5\u5f00\u59cb\u5bf9\u8bdd\uff0c\u6216\u4ece\u53f3\u4fa7\u9009\u62e9\u6a21\u5f0f\u540e\u5f00\u59cb\u5bf9\u8bdd"], ["\u7ed9\u4e2a\u6392\u5e8f\u7684\u4ee3\u7801", "<p>\u8fd9\u91cc\u662f\u4e00\u4e2a\u4f7f\u7528Python\u5185\u7f6e\u7684<code>sorted()</code>\u51fd\u6570\u5bf9\u5217\u8868\u8fdb\u884c\u6392\u5e8f\u7684\u793a\u4f8b\uff1a</p>\n<pre><code class=\"language-scss\"><div class=\"highlight\"><pre><span></span><span class=\"nt\">my_list</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"o\">[</span><span class=\"nt\">1</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">2</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">3</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">4</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">5</span><span class=\"o\">]</span>\n<span class=\"nt\">sorted_list</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"nt\">sorted</span><span class=\"o\">(</span><span class=\"nt\">my_list</span><span class=\"o\">)</span>\n\n<span class=\"nt\">print</span><span class=\"o\">(</span><span class=\"nt\">sorted_list</span><span class=\"o\">)</span>\n</pre></div>\n</code></pre>\n<p>\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a</p>\n<pre><code><div class=\"highlight\"><pre><span></span>[1, 2, 3, 4, 5]\n</pre></div>\n</code></pre>\n<p>\u5982\u679c\u4f60\u9700\u8981\u5bf9\u591a\u4e2a\u5217\u8868\u8fdb\u884c\u6392\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sorted()</code>\u51fd\u6570\u7684\u591a\u4e2a\u53c2\u6570\uff0c\u5982\u4e0b\uff1a</p>\n<pre><code class=\"language-scss\"><div class=\"highlight\"><pre><span></span><span class=\"nt\">list1</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"o\">[</span><span class=\"nt\">1</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">2</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">3</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">4</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">5</span><span class=\"o\">]</span>\n<span class=\"nt\">list2</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"o\">[</span><span class=\"nt\">6</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">7</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">8</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">9</span><span class=\"o\">,</span><span class=\"w\"> </span><span class=\"nt\">10</span><span class=\"o\">]</span>\n\n<span class=\"nt\">sorted_list1</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"nt\">sorted</span><span class=\"o\">(</span><span class=\"nt\">list1</span><span class=\"o\">)</span>\n<span class=\"nt\">sorted_list2</span><span class=\"w\"> </span><span class=\"o\">=</span><span class=\"w\"> </span><span class=\"nt\">sorted</span><span class=\"o\">(</span><span class=\"nt\">list2</span><span class=\"o\">)</span>\n\n<span class=\"nt\">print</span><span class=\"o\">(</span><span class=\"nt\">sorted_list1</span><span class=\"o\">)</span>\n<span class=\"nt\">print</span><span class=\"o\">(</span><span class=\"nt\">sorted_list2</span><span class=\"o\">)</span>\n</pre></div>\n</code></pre>\n<p>\u8f93\u51fa\u7ed3\u679c\u4e3a\uff1a</p>\n<pre><code><div class=\"highlight\"><pre><span></span>[1, 2, 3, 4, 5]\n[6, 7, 8, 9, 10]\n</pre></div>\n</code></pre>\n"], ["\u4f60\u77e5\u9053\u6bd4\u7279\u5e01\u5417\uff1f", "\u662f\u7684\uff0c\u6bd4\u7279\u5e01\u662f\u4e00\u79cd\u6570\u5b57\u8d27\u5e01\uff0c\u4f60\u53ef\u4ee5\u5728\u4e92\u8054\u7f51\u4e0a\u8fdb\u884c\u5b89\u5168\u7684\u4ea4\u6613\uff0c\u800c\u65e0\u9700\u62c5\u5fc3\u4f20\u7edf\u8d27\u5e01\u6c47\u6b3e\u548c\u94f6\u884c\u670d\u52a1\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898\u3002\u6bd4\u7279\u5e01\u662f\u4e00\u79cd\u53bb\u4e2d\u5fc3\u5316\u7684\u6570\u5b57\u8d27\u5e01\uff0c\u4f7f\u7528\u5206\u5e03\u5f0f\u8d26\u672c\u6280\u672f\uff08\u533a\u5757\u94fe\uff09\u8bb0\u5f55\u4ea4\u6613\uff0c\u56e0\u6b64\u4e0d\u53d7\u4efb\u4f55\u653f\u5e9c\u6216\u94f6\u884c\u7684\u9650\u5236\u3002"]] |