We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fb2c5e commit 89f44a2Copy full SHA for 89f44a2
ex20.py
@@ -4,8 +4,7 @@
4
5
6
def print_all(f):
7
- print
8
- f.read()
+ print(f.read())
9
10
11
# seek(n) to read a file's content from byte-n
@@ -14,22 +13,18 @@ def rewind(f):
14
13
15
16
def print_a_line(line_count, f):
17
18
- line_count, f.readline()
+ print(line_count, f.readline())
19
20
21
current_file = open(input_file)
22
23
-print
24
-"First let's print the whole file:\n"
+print("First let's print the whole file:\n")
25
print_all(current_file)
26
27
28
-"Now let's rewind, kind of like a tape."
+print("Now let's rewind, kind of like a tape.")
29
rewind(current_file)
30
31
32
-"Let's print three lines:"
+print("Let's print three lines:")
33
current_line = 1
34
print_a_line(current_line, current_file)
35
0 commit comments