list reverse

You can make use of the reversed function for this as:

>>> array=[0,10,20,40]
>>> for i in reversed(array):
...     print(i)

Note that reversed(...) does not return a list. You can get a reversed list using list(reversed(array)).

原文地址:https://www.cnblogs.com/kakaisgood/p/9081680.html