diff --git a/input_output.ipynb b/input_output.ipynb index 95743d07..6fc1f5ce 100644 --- a/input_output.ipynb +++ b/input_output.ipynb @@ -129,7 +129,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "1. Complete the function `solution_print_odd` to **print** all the *odd* numbers between 0 and `n`. The value of `n` is provided as the single parameter of the function." + "1. Complete the function `solution_print_odd` to **print** all the *odd* numbers between 0 and `n`, **without `n`**. The value of `n` is provided as the parameter of the function `solution_print_odd`." ] }, { @@ -155,7 +155,7 @@ "\n", "
\n", "

Note

\n", - " There is no test for this exercise because of the way capturing the user input works\n", + " There is no test for this exercise because we cannot easily interact with input in our testing framework. You can check visually if the input does what is expected.\n", "
" ] }, @@ -597,7 +597,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "1. Modify the function `solution_write_file` to write the sentence \"python tutorial 2023\" to the file `output_file` passed as argument to the function" + "1. Modify the function `solution_write_file` to write the sentence \"python tutorial 2023\" (**without quotes**) to the file `output_file`, which is available as a `Path` object as argument to the function." ] }, { @@ -621,7 +621,17 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "2. Modify the function `solution_read_write_file` to read the lines from the file `input_file` and write them in the form `line, length`, to the file `output_file`. Here `line` is the corresponding line of text in `input_file`, `length` is **number of characters** in that line" + "1. Modify the function `solution_read_write_file` to read the lines from the file `input_file` and write them in the form `line, length`, to the file `output_file`. Here `line` is the line of text in `input_file` **without the line ending**, `length` is **number of characters** in that line.\n", + "If `input_file` contains these lines:\n", + " ```\n", + " first\n", + " second\n", + " ```\n", + " we expect the output file to contain these lines:\n", + " ```\n", + " first, 5\n", + " second, 6\n", + " ```" ] }, {