File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
def print_all (f ):
7
- print
8
- f .read ()
7
+ print (f .read ())
9
8
10
9
11
10
# seek(n) to read a file's content from byte-n
@@ -14,22 +13,18 @@ def rewind(f):
14
13
15
14
16
15
def print_a_line (line_count , f ):
17
- print
18
- line_count , f .readline ()
16
+ print (line_count , f .readline ())
19
17
20
18
21
19
current_file = open (input_file )
22
20
23
- print
24
- "First let's print the whole file:\n "
21
+ print ("First let's print the whole file:\n " )
25
22
print_all (current_file )
26
23
27
- print
28
- "Now let's rewind, kind of like a tape."
24
+ print ("Now let's rewind, kind of like a tape." )
29
25
rewind (current_file )
30
26
31
- print
32
- "Let's print three lines:"
27
+ print ("Let's print three lines:" )
33
28
current_line = 1
34
29
print_a_line (current_line , current_file )
35
30
You can’t perform that action at this time.
0 commit comments