diff --git a/ex20.py b/ex20.py index 43a3381e97d..78dc206831d 100644 --- a/ex20.py +++ b/ex20.py @@ -4,8 +4,7 @@ def print_all(f): - print - f.read() + print(f.read()) # seek(n) to read a file's content from byte-n @@ -14,22 +13,18 @@ def rewind(f): def print_a_line(line_count, f): - print - line_count, f.readline() + print(line_count, f.readline()) current_file = open(input_file) -print -"First let's print the whole file:\n" +print("First let's print the whole file:\n") print_all(current_file) -print -"Now let's rewind, kind of like a tape." +print("Now let's rewind, kind of like a tape.") rewind(current_file) -print -"Let's print three lines:" +print("Let's print three lines:") current_line = 1 print_a_line(current_line, current_file)