欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

python面试如何以相反顺序展示一个文件的内容?

程序员文章站 2023-11-15 19:06:16
>>> for line in reversed(list(open('Today.txt'))): print(line.rstrip())containeritertools DebuggerThis sem’s subjects Python, C++, JavaHTML, CSS, jQue ......

>>> for line in reversed(list(open('today.txt'))):
print(line.rstrip())
container
itertools

debugger
this sem’s subjects

python, c++, java
html, css, jquery, javascript

os, dbms, ds, ada

 

本文首发于python黑洞网,博客园同步更新