0

To display the contents of a file in reverse, the following code can be used:

for line in reversed(list(open(filename.txt))):
print(line.rstrip())
Malarvizhi M Asked question June 3, 2023