diff --git a/main.ipynb b/main.ipynb index 2b94ca7..b6cd1a0 100644 --- a/main.ipynb +++ b/main.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -37,19 +37,38 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ - "def greater(a,b):\n", - " pass" + "def greater(a,b): \n", + " pass\n", + "\n", + "def greater(a, b):\n", + " \n", + " if a < b:\n", + " return b\n", + " else:\n", + " return a" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.076s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" @@ -64,19 +83,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def greatest(arr):\n", - " pass" + " pass\n", + " \n", + "def greatest(arr):\n", + " \n", + " largest = arr[0]\n", + " \n", + " for i in arr:\n", + " if i > largest:\n", + " largest = i\n", + " \n", + " return largest" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.067s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" @@ -91,19 +132,38 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def sum_all(arr):\n", - " pass" + " pass\n", + "\n", + "def sum_all(arr):\n", + " x = 0\n", + " for i in arr:\n", + " x += i\n", + " \n", + " return x" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.062s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" @@ -118,19 +178,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "def mult_all(arr):\n", - " pass" + " pass\n", + "\n", + "def mult_all(arr):\n", + " y = 1\n", + " \n", + " for i in arr:\n", + " y *= i\n", + " \n", + " return y" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.067s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,19 +225,56 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper):\n", - " pass" + " pass\n", + "\n", + "def oper_all(arr, oper):\n", + " if oper == '+':\n", + " c = 0\n", + " for i in arr:\n", + " c += i\n", + " else:\n", + " c = 1\n", + " for i in arr:\n", + " c *= i\n", + " \n", + " return c " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], + "source": [ + "def oper_all(arr, oper):\n", + " if oper == \"+\":\n", + " return sum_all(arr)\n", + " elif oper == \"*\":\n", + " return mult_all(arr)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.069s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -172,19 +289,53 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "def factorial(n):\n", - " pass" + " pass\n", + "\n", + "def factorial(n):\n", + " \n", + " d= 1\n", + " \n", + " for i in range (1, n + 1):\n", + " d *= i\n", + " \n", + " return d" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [], + "source": [ + "def oper_all(arr, oper):\n", + " if oper == \"+\":\n", + " return sum_all(arr)\n", + " elif oper == \"*\":\n", + " return mult_all(arr)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.142s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -201,19 +352,868 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "def unique(arr):\n", - " pass" + " pass\n", + "\n", + "\n", + "def oper_all(arr, oper):\n", + " if oper == \"+\":\n", + " return sum_all(arr)\n", + " elif oper == \"*\":\n", + " return mult_all(arr)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 112, in runTest\n", + " self.assertEqual(set(fn(self.input)), self.output, f\"Should be {self.output}\")\n", + "TypeError: 'NoneType' object is not iterable\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.192s\n", + "\n", + "FAILED (errors=100)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -229,17 +1229,61 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "def st_dev(arr):\n", - " pass" + " pass\n", + "\n", + "def st_dev(arr):\n", + " \n", + " if not arr:\n", + " return None #none daba probelmas¿?\n", + " \n", + " sum_i = 0\n", + " n = 0\n", + " \n", + " for i in arr:\n", + " sum_i += i\n", + " n += 1\n", + " \n", + " mean = sum_i / n\n", + " \n", + " squared_diff = 0\n", + " for i in arr:\n", + " squared_diff += (i - mean) ** 2\n", + " \n", + " variance = squared_diff / (n - 1)\n", + " st_deviation = variance ** 0.5\n", + " \n", + " return st_deviation" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.185s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -249,7 +1293,51 @@ "# Our tests need to be improved, so for this exercise, we care about the code itself. You may check if you get\n", "# similar results by checking with:\n", "\n", - "from statistics import stdev" + "from statistics import stdev\n", + "\n", + "def st_dev(arr):\n", + " \n", + " if not arr:\n", + " return None #none daba probelmas¿?\n", + " \n", + " sum_i = 0\n", + " n = 0\n", + " \n", + " for i in arr:\n", + " sum_i += i\n", + " n += 1\n", + " \n", + " mean = sum_i / n\n", + " \n", + " squared_diff = 0\n", + " for i in arr:\n", + " squared_diff += (i - mean) ** 2\n", + " \n", + " variance = squared_diff / (n - 1)\n", + " st_deviation = variance ** 0.5\n", + " \n", + " return st_deviation" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.154s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" ] }, { @@ -261,19 +1349,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - " pass" + " pass\n", + "\n", + "def pangram(string):\n", + " \n", + " letters = [0] * 26\n", + " \n", + " for char in string:\n", + " char = char.lower()\n", + " if 'a' <= char <= 'z':\n", + " index =ord(char) - ord('a')\n", + " letters[index] = 1\n", + " \n", + " return all(letters)\n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.034s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -289,19 +1402,61 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "def check_pass(string):\n", - " pass" + " pass\n", + "\n", + "def check_pass(string):\n", + " has_lower = False\n", + " has_upper = False\n", + " has_number = False\n", + " has_special = False\n", + " \n", + " length = 0\n", + " \n", + " for char in string:\n", + " length += 1\n", + " \n", + " if length < 8:\n", + " return False\n", + " \n", + " for char in string:\n", + " if 'a' <= char <= 'z':\n", + " has_lower = True\n", + " \n", + " elif 'A' <= char <= 'Z':\n", + " has_upper = True\n", + " \n", + " elif '0' <= char <= '9':\n", + " has_number = True\n", + " \n", + " elif char in \"!@#$%^&*()_+{}[]:;<>,.?/~\":\n", + " has_special = True\n", + " \n", + " \n", + " return has_lower and has_upper and has_number and has_special" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.167s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" @@ -324,19 +1479,48 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "def mode_counter(arr):\n", - " pass" + " if not arr:\n", + " return None \n", + " \n", + " i_count = {} \n", + " max_count = 0\n", + " mode = None\n", + " \n", + " for i in arr:\n", + " if i in i_count:\n", + " i_count[i] += 1\n", + " else:\n", + " i_count[i] = 1\n", + " \n", + " if i_count[i] > max_count:\n", + " max_count = i_count[i]\n", + " mode = i\n", + " \n", + " return mode " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.161s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -353,19 +1537,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ "def sort_alpha(string):\n", - " pass" + " words = string.split(',')\n", + " \n", + " sorted_words = sorted(words)\n", + " \n", + " result = ','.join(sorted_words)\n", + " \n", + " return result" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 47, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.146s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_alpha(sort_alpha)" @@ -388,7 +1590,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.10.9" }, "toc": { "base_numbering": 1,