# -*- coding: GBK -*-
#reverse: 相反的
cars = ["bmw", "audi", "toyota", "subaru"] print(cars) cars.reverse()
print(cars)
输出为:
['bmw', 'audi', 'toyota', 'subaru']
['subaru', 'toyota', 'audi', 'bmw']
2023-10-09 21:02:22
# -*- coding: GBK -*-
#reverse: 相反的
cars = ["bmw", "audi", "toyota", "subaru"] print(cars) cars.reverse()
print(cars)
输出为:
['bmw', 'audi', 'toyota', 'subaru']
['subaru', 'toyota', 'audi', 'bmw']