empa-scientific-it / python-tutorial

Material for a Jupyter-based Python tutorial
MIT License
30 stars 9 forks source link

Errors found in the `input_output` notebook #236

Open despadam opened 4 months ago

despadam commented 4 months ago
yakutovicha commented 4 months ago

The exercise solution_find_all_files has issues:

despadam commented 4 months ago

In writing to a file section:

despadam commented 4 months ago

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 commented 4 months ago

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