倒序输出

ll= [1,2,3,4,5]
print ll[::-1]

ll.reverse() 

for l in reversed(ll):
print l

倒序读取文件:

with open(filepath,'rb') as fo:
    lines = fo.readlines() #lines是一个list

for line in reversed(lines): #倒序读取行
     print line
原文地址:https://www.cnblogs.com/dreamer-fish/p/5761734.html