How to reverse a list of lists in python? [duplicate]
问题 This question already has answers here : How can I reverse a list in Python? (33 answers) Closed 5 years ago . I was wondering how to reverse a list of lists in python. For example, Original: list = [[1,2,3],[4,5,6],[7,8,9]] Output: new_list = [[7,8,9],[4,5,6],[1,2,3]] Right now, I am trying this: new_list = reversed(list) However, this doesn't seem to work. 回答1: In [24]: L = [[1,2,3],[4,5,6],[7,8,9]] In [25]: L[::-1] Out[25]: [[7, 8, 9], [4, 5, 6], [1, 2, 3]] 来源: https://stackoverflow.com