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, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 09:40
Healthy study habits are best described as
Answers: 1
question
Computers and Technology, 25.06.2019 08:50
Write multiple if statements: if caryear is before 1968, print "probably has few safety features." (without quotes). if after 1971, print "probably has seat belts.". if after 1991, print "probably has anti-lock brakes.". if after 2002, print "probably has airbags.". end each phrase with period and newline. ex: caryear = 1995 prints:
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
Mathematics, 02.10.2019 07:10
question
Advanced Placement (AP), 02.10.2019 07:10
Questions on the website: 13722366