Text Files · 13 / 17 Exercise Medium

Reverse text from a file

Objective

Create a Python program that makes a copy of a text file but reverse all its content. Create a file with the same name but with extension "inv".

Files: read the file notes.txt (it already exists) and save a copy in notes.inv where every line is written reversed (from the last character to the first); the order of the lines does not change. The program must not print anything.

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise