Question: 1 from sys import argv 3 script, input file argv 4 5 def print all(f) print f.readO 8 def rewind(f): f.seek (O) 10 11 def

 1 from sys import argv 3 script, input file argv 4

5 def print all(f) print f.readO 8 def rewind(f): f.seek (O) 10

1 from sys import argv 3 script, input file argv 4 5 def print all(f) print f.readO 8 def rewind(f): f.seek (O) 10 11 def print a line(1ine_count, f): 12 13 14 current file open (input file) 15 16 print "First let's print the whole file:In" 17 18 print all(current file) 19 20 print "Now let's rewind, kind of 1ike a tape." 21 22 rewind(current file) 23 24 print "Let's print three 1ines:" 25 26 current line 1 27 print a line(current line, current file) 28 29 currentTine current line 1 30 print_a_line (current line, current file) 31 32 currentTine current_line 1 33 print a line (current line, current file) print 1ine_count, f.readlineO Pay close attention to how we pass in the current line number each time we run print_a_line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!