- What You Should See
- Study Drills
- Common Student Questions
Study Drills
Write an English comment for each line to understand what that line does.
Each time print_a_line is run, you are passing in a variable, current_line. Write out what current_line is equal to on each function call, and trace how it becomes line_count in print_a_line.
Find each place a function is used, and check its def to make sure that you are giving it the right arguments.
Research online what the seek function for file does. Try pydoc file, and see if you can figure it out from there. Then try pydoc file.seek to see what seek does.
Research the shorthand notation +=, and rewrite the script to use += instead.