直接上代码:
[root@center-me python]# python array.py ['b', 'c', 'a', 'f', 'g', '3', '2', '1'] ['1', '2', '3', 'a', 'b', 'c', 'f', 'g'] [root@center-me python]# [root@center-me python]# cat array.py list_a = ["b","c","a","f","g","3","2","1"] list_b = list_a[ : ] list_b.sort() print list_a print list_b [root@center-me python]#
——————————————
Done。