<p class="codetitle"> 代码如下:</p> <p class="codebody" id="code24143"> <br>def quick_sort(ls): <br>return [] if ls == [] else quick_sort([y for y in ls[1:] if y = ls[0]]) <br><br>if __name__ == '__main__': <br>l1 = [3,56,8,1,34,56,89,234,56,231,45,90,33,66,88,11,22] <br>l2 = quick_sort(l1) <br>print l1 <br>print l2 <br></p> <br>注意:quick_sort函数中的代码是在一行里面的