place=['shanghai','lanzhou','xian','jiangsu','hainan','shangxi']
print(place)
print("\n",sorted(place))#sorted函数,暂时按顺序排列
print("\n",place)
print("\n",sorted(place,reverse=True))#暂时反顺序;sorted为函数,用于数据传递
place.reverse()#倒着排列
print("\n",place)
place.reverse()#再次倒着排列,恢复原位
print("\n",place)
place.sort() #sort为方法,可调用,永久按顺序排列
print("\n",place)
place.sort(reverse=True) #sort方法,永久反顺序排列
print("\n",place)
print("\n",len(place))
for PP in place:#place中取元素,储存在PP中,循环至结束
print("\n",PP.title()+",is a good place!")#PP或者PP.title()都行
print("I can't wait to see, " + PP.title() + ".\n")
列表排序~
读取列表~