python-tutorial
python-tutorial copied to clipboard
Errors found in the `input_output` notebook
- [ ] Add a line to execute
solution_print_salutation(), so they can see the output, since this one cannot be tested normally
The exercise solution_find_all_files has issues:
- We provide the following solution
list(f.parent.iterdir())but it should not haveparentin it. - The path argument in our solution should be
current_pathinstead offfor consistency.
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_fileshould be removed from this section. It is a duplicate
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
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