subject
Computers and Technology, 30.03.2021 20:10 kahliey

Write a Python function named backwards that takes two str parameters: an input filename and an output filename. The function shall open the input file, read its contents, and create the output file with the words of each line in reverse order. Notes: • The newline character ('\n') still appears at the end of the line. • You do not have to provide comments for this code. • Extra credit for not using the reverse method or the reversed function. Example: If the file seuss. txt has the contents shown below, the following command will create the reversed. txt file, with the indicated contents. backwards(' seuss. txt', 'reversed. txt') The newline character is displayed as an arrow: - seuss. txt The Cat in the Hat Green Eggs and Hamd Fox in Socks Hop on Pop The Lorax - reversed. txt Hat the in Cat The Ham and Eggs Greend Socks in Fox Pop on Нор Lorax The The backwards function you just wrote is in a module named file_operations. Update the module with a testing main function that will call backwards. The testing main shall use seuss. txt as the input file and create the file reversed. txt. The testing main shall run with the module itself is run, but not when the module is imported.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
What operating system is a smartphone most likely to use? 1.bsd 2.mac os x 3.symbian 4.linux
Answers: 1
question
Computers and Technology, 22.06.2019 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
You know the right answer?
Write a Python function named backwards that takes two str parameters: an input filename and an outp...
Questions
question
English, 11.12.2020 04:40
question
Mathematics, 11.12.2020 04:40
question
Mathematics, 11.12.2020 04:40
question
Mathematics, 11.12.2020 04:40
question
Mathematics, 11.12.2020 04:40
Questions on the website: 13722360