"""列表是由一系列按特定顺序排列的元素组成,可以将任何东西加入列表,其中的元素可以彼此没有任何关系。
python中通常用“[]”表示,用逗号分开其中的元素
"""
bicycles = ['trek', 'cannondale', 'redline', 'specialized']
print(bicycles)
print(bicycles[0])
print(bicycles[-1])
metorcycles = ['honda', 'yamaha', 'suzuki']
print(metorcycles)
metorcycles[0] = 'ducati'
print(metorcycles)
metorcycles.append('ducati')
metorcycles = []
metorcycles.append('honda')
metorcycles.insert(0, 'ducati')
del metorcycles[0]
popped_metorycles = metorcycles.pop()
first_owned = metorcycles.pop(0)
metorcycles.remove('ducati')
cars = ['bmw', 'audi', 'toyota', 'subaru']
cars.sort()
print(cars)
cars = ['bmw', 'audi', 'toyota', 'subaru']
cars.sort(reverse=True)
print(cars)
print(sorted(cars))
cars.reverse()
len(cars)