#coding:utf-8
#621晚上
cars =['bmw','audi','toyota','subaru']
cars.sort() #sort表示对列表的永久排列
print(cars)
cars.sort(reverse=True) #reverse=True:T要大写,能够按与字母相反的顺序排列
print(cars)
cars =['bmw','audi','toyota','subaru']
print("Here is the original list")
print(cars)
print("\nHere is the sorted list") #换行
print(sorted(cars)) #sorted表示临时排序
print("\nHere is the original list again:")
print(cars)
#reverse()永久按反转顺序排列
print("\n")
cars =['bmw','audi','toyota','subaru']
print(cars)
print("下面是反转排列")
cars.reverse()
print(cars)