Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 34410ae

Browse filesBrowse files
authored
Improved description of exercises (input/output) (empa-scientific-it#116)
1 parent 0e76f4f commit 34410ae
Copy full SHA for 34410ae

File tree

Expand file treeCollapse file tree

1 file changed

+14
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-4
lines changed

‎input_output.ipynb

Copy file name to clipboardExpand all lines: input_output.ipynb
+14-4Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"cell_type": "markdown",
130130
"metadata": {},
131131
"source": [
132-
"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."
132+
"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`."
133133
]
134134
},
135135
{
@@ -155,7 +155,7 @@
155155
"\n",
156156
"<div class=\"alert alert-block alert-warning\">\n",
157157
" <h4><b>Note</b></h4>\n",
158-
" There is no test for this exercise because of the way capturing the user input works\n",
158+
" There is no test for this exercise because we cannot easily interact with <code>input</code> in our testing framework. You can check visually if the input does what is expected.\n",
159159
"</div>"
160160
]
161161
},
@@ -597,7 +597,7 @@
597597
"cell_type": "markdown",
598598
"metadata": {},
599599
"source": [
600-
"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"
600+
"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."
601601
]
602602
},
603603
{
@@ -621,7 +621,17 @@
621621
"cell_type": "markdown",
622622
"metadata": {},
623623
"source": [
624-
"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"
624+
"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",
625+
"If `input_file` contains these lines:\n",
626+
" ```\n",
627+
" first\n",
628+
" second\n",
629+
" ```\n",
630+
" we expect the output file to contain these lines:\n",
631+
" ```\n",
632+
" first, 5\n",
633+
" second, 6\n",
634+
" ```"
625635
]
626636
},
627637
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.