Skip to content

Commit 12ed50b

Browse files
committed
extra credit - used += to shorten code
1 parent 5425cb9 commit 12ed50b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ex20.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def print_a_line(line_count, f):
4343
print_a_line(current_line, current_file)
4444

4545
# set current line to itself + 1
46-
current_line = current_line + 1
46+
current_line += 1
4747
# call print_a_line function with current_line and current_file as arguments
4848
print_a_line(current_line, current_file)
4949

5050
# set current line to itself + 1
51-
current_line = current_line + 1
51+
current_line += 1
5252
# call print_a_line function with current_line and current_file as arguments
5353
print_a_line(current_line, current_file)

0 commit comments

Comments
 (0)