Given a test file named “test.txt” containing the following three lines:
Line OneLine TwoLine Three
Consider the following code:
someFile = open('test.txt', 'r') for line in someFile: # Loop 1 print line for line in someFile: # Loop 2 print line(a) What will be printed by Loop 1?
(b) What will be printed by Loop 2?
(c) How can you modify the code so that both Loop 1 and Loop 2 print the same thing (other than having them both print nothing)?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.