II. (30+44+44=118 pts) This part contains two code-writing questions, and one question on a
simple class implementation.
1. Consider the following function.
def some_fun(infilename, outfilename):
ifile = open(infilename, 'r')
ofile = open(outfilename, 'w')
for line in ifile:
L = list(filter(lambda x: len(x) > 1, line.split()))
for item in L:
ofile.write(item + " ")
ofile.write('\n')
ifile.close()
ofile.close()
Suppose now that we have a file called "in.txt" whose contents are as follows:
a one b two c three
first 9 120 12 24 12 212
second 0 0 6 12 12 12
third 1 2 1 2 1 2
Assume we have imported the function some_fun. What are the contents of the file
"out.txt" after the function call result of the following function call?
>>> some_fun("in.txt", "out.txt")
Answer:
Explain, in general terms, exactly what the function some_fun is doing. Give a general
explanation of the function's actions (do not simply repeat the code in English sentences
Answer: