Commit d1bbbe7a authored by paugier's avatar paugier
Browse files

Fix pres function (without unittest)

parent b7a59175
Pipeline #32463 passed with stage
in 51 seconds
......@@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
......@@ -86,12 +86,10 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import unittest \n",
"\n",
"def add(arg0, arg1):\n",
" \"\"\"Print and return the sum of the two arguments (duck typing).\"\"\"\n",
" result = arg0 + arg1\n",
......@@ -168,12 +166,10 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"import unittest\n",
"\n",
"def add_second_twice(arg0, arg1):\n",
" \"\"\"Return the sum of the first argument with twice the second one.\n",
" Arguments should be of type that support sum and product by \n",
......@@ -182,8 +178,7 @@
" :param arg1: second argument \n",
" :return: arg0 + 2 * arg1\n",
" \"\"\"\n",
" pass\n",
"\n"
" pass\n"
]
},
{
......@@ -201,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {
"slideshow": {
"slide_type": "-"
......@@ -221,7 +216,7 @@
"16"
]
},
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
......@@ -239,32 +234,14 @@
" print(f'arg0 + 2*arg1 = {arg0} + 2*{arg1} = {result}')\n",
" return result\n",
"\n",
"myfunc(4, 6)"
"add_second_twice(4, 6)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"arg0 + 2*arg1 = a + 2*b = abb\n"
]
},
{
"data": {
"text/plain": [
"'abb'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"myfunc('a', 'b')"
]
......@@ -306,7 +283,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
"version": "3.7.2"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment