Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code in python3 pls Write a function called writeLines() that takes a filename (string) and a list of strings as arguments and prints the given

code in python3 pls

Write a function called writeLines() that takes a filename (string) and a list of strings as arguments and prints the given list to the given file. The function should replace the file if it already exists, and should create a new file if it does not already exist.

Write a function called reverseFile() that takes a filename (string) and creates a new file called reverse_filename, in which each line of text in the input file is printed in reverse. That is, the first line in the output file should be the last line of the input file, the second line of output should be the second last line of input. Each individual line should read the same (left-to-right) as it did in the input file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago