在Python 中若要對list 中的元素進行排序,有兩種方式,一種是使用 sorted ,他會對元素排序 ... x = [4, 2, 5, 3, 1] # 反向排序 x.sort(reverse = True) print(x).
確定! 回上一頁