Question: Program should be written in python 2. Write a program that reads each line in a file, reverses its lines, and writes them to another
2. Write a program that reads each line in a file, reverses its lines, and writes them to another file. For example, the previous file lamb.txt contains the lines Mary had a little lamb Whose fleece was white as snow And everywhere that Mary went The lamb was sure to go! and you run reverse lamb.txt to out lamb.tx then out lamb.txt contains The lamb was sure to go. And everywhere that Mary went Whose fleece was white as snow Mary had a liule lamb lint: You might use loop or simply readline() and write) methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
