python-tutorial icon indicating copy to clipboard operation
python-tutorial copied to clipboard

Errors found in the `input_output` notebook

Open despadam opened this issue 1 year ago • 4 comments

  • [ ] Add a line to execute solution_print_salutation(), so they can see the output, since this one cannot be tested normally

despadam avatar May 07 '24 08:05 despadam

The exercise solution_find_all_files has issues:

  • We provide the following solution list(f.parent.iterdir()) but it should not have parent in it.
  • The path argument in our solution should be current_path instead of f for consistency.

yakutovicha avatar May 07 '24 08:05 yakutovicha

In writing to a file section:

  • we have 3 exercises but they are enumerated wrongly (instead of 1,2,3 we have 1,2,1)
  • solution_read_file should be removed from this section. It is a duplicate

despadam avatar May 07 '24 09:05 despadam

In some reference solutions we already use context managers before they are later introduced. Let's update those solutions to use the syntax where we manually close a file at the end. Then we can add a new exercise in the context managers section to introduce the new syntax

despadam avatar May 07 '24 09:05 despadam

In reference_read_write_file we are using line.strip() and len(line) for a string. However we haven't introduced any of these two in the section for strings in basic_datatypes

despadam avatar May 07 '24 09:05 despadam