tmps=",".join([str(c) for c in [int(c) for c in tmps.split(",")].sort()])

分開寫是這樣

tmps='12,123,1111,133'

str_list=tmps.split(",")

int_list=[int(c) for c in str_list]

int_list.sort()

str_list2=['%s'%c for c in int_list]

output_str=",".joint(str_list2)

相关文章