diff --git a/lesson_0_comments.ipynb b/lesson_0_comments.ipynb index 56912c1..637fcc7 100644 --- a/lesson_0_comments.ipynb +++ b/lesson_0_comments.ipynb @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -46,9 +46,7 @@ "output_type": "stream", "text": [ "3\n", - "10\n", - "5\n", - "24\n" + "10\n" ] } ], @@ -59,23 +57,35 @@ "\n", "\n", "def add(*args, **kwargs):\n", - " # get the comment arguments\n", " c_args, c_kwargs = comment_arguments()\n", - " # parse integers\n", - " input_ints = [int(i) for i in args + c_args]\n", - " # sum integers\n", - " result = sum(input_ints)\n", - " return result\n", + " return sum([int(i) for i in args + c_args])\n", "\n", "\n", "# Go ahead and change the comments.\n", - "# See how python uses them as arguments.\n", + "# See how they are used as arguments.\n", "\n", "result = add() # 1, 2\n", "print(result)\n", "# comment arguments can be combined with normal function arguments\n", "result = add(1, 2) # 3, 4\n", - "print(result)\n", + "print(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n", + "24\n" + ] + } + ], + "source": [ "result = add(\n", " add(1) # 2\n", ") # 2\n",