Workout #24: Reverse Lines

Oct 10, 2021

In many cases, we want to take a file in one format and save it to another format. In this function, we do a basic version of this idea. The function takes two arguments: the names of the input file (to be read from) and the output file (which will be created).

For example, if a file looks like

abc def
ghi jkl

then the output file will be

fed cba
lkj ihg

TRY IT YOURSELF

ANSWER

https://colab.research.google.com/drive/1fmTD6fcPqOd_Q-JRLGmyWinYPyUZ5Mw2?usp=sharing

--

--

Abish Pius
Abish Pius

Written by Abish Pius

Data Science Professional, Python Enthusiast, turned LLM Engineer

No responses yet