From c278b07d4394142a8312690b6b96ca9bdc3146ad Mon Sep 17 00:00:00 2001 From: Estherkii <123992666+Estherkii@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:52:00 +0200 Subject: [PATCH 1/2] upload --- main.ipynb | 1253 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1206 insertions(+), 47 deletions(-) diff --git a/main.ipynb b/main.ipynb index 2b94ca7..b7b89ba 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": 15, "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": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.058s\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": 74, "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": 75, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.061s\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": 87, "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": 88, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.070s\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": 91, "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": 92, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.060s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,19 +225,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 96, "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": 97, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.061s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -172,19 +276,40 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 106, "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": 107, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.071s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -201,19 +326,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 118, "metadata": {}, "outputs": [], "source": [ "def unique(arr):\n", - " pass" + " pass\n", + "\n", + "def unique(arr):\n", + " u_values = []\n", + " \n", + " for i in arr:\n", + " uniq = True\n", + " for value in u_values:\n", + " if i == value:\n", + " uniq = False\n", + " break\n", + " \n", + " if uniq:\n", + " u_values = u_values + [i]\n", + " \n", + " return u_values" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 119, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.201s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -229,17 +381,61 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 158, "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": null, + "execution_count": 159, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.057s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" + ] + }, + { + "cell_type": "code", + "execution_count": 162, "metadata": {}, "outputs": [], "source": [ @@ -249,7 +445,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": 163, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.065s\n", + "\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" ] }, { @@ -261,19 +501,44 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 176, "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": 177, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.024s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -289,19 +554,61 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 221, "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": 222, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.061s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" @@ -324,19 +631,871 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 223, "metadata": {}, "outputs": [], "source": [ "def mode_counter(arr):\n", - " pass" + " pass\n", + "\n", + "def mode_counter(arr):\n", + " mode = None\n", + " i_most = 0\n", + " \n", + " for i in arr:\n", + " count = 0\n", + "\n", + " #I tried many times but I can't finally get the right result!\n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 224, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 16 : Should be 16\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 14 : Should be 14\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 4 : Should be 4\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 12 : Should be 12\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 21 : Should be 21\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 16 : Should be 16\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 24 : Should be 24\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 15 : Should be 15\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 2 : Should be 2\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 2 : Should be 2\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 15 : Should be 15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 17 : Should be 17\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 19 : Should be 19\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 23 : Should be 23\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 5 : Should be 5\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 13 : Should be 13\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 16 : Should be 16\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 15 : Should be 15\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 18 : Should be 18\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 1 : Should be 1\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 3 : Should be 3\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 9 : Should be 9\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 22 : Should be 22\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 23 : Should be 23\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 10 : Should be 10\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 7 : Should be 7\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 21 : Should be 21\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 2 : Should be 2\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 11 : Should be 11\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 25 : Should be 25\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 12 : Should be 12\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 20 : Should be 20\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 8 : Should be 8\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + "AssertionError: None != 6 : Should be 6\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.082s\n", + "\n", + "FAILED (failures=100)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -388,7 +1547,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.10.9" }, "toc": { "base_numbering": 1, From 76f582c0534ba18a142580954a0db6292b8323ef Mon Sep 17 00:00:00 2001 From: Estherkii <123992666+Estherkii@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:42:49 +0200 Subject: [PATCH 2/2] corrections --- main.ipynb | 1633 +++++++++++++++++++++++++++------------------------- 1 file changed, 838 insertions(+), 795 deletions(-) diff --git a/main.ipynb b/main.ipynb index b7b89ba..b6cd1a0 100644 --- a/main.ipynb +++ b/main.ipynb @@ -37,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -63,7 +63,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.058s\n", + "Ran 100 tests in 0.076s\n", "\n", "OK\n" ] @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -112,7 +112,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.061s\n", + "Ran 100 tests in 0.067s\n", "\n", "OK\n" ] @@ -132,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -149,7 +149,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -158,7 +158,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.070s\n", + "Ran 100 tests in 0.062s\n", "\n", "OK\n" ] @@ -178,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -196,7 +196,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -205,7 +205,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.060s\n", + "Ran 100 tests in 0.067s\n", "\n", "OK\n" ] @@ -225,7 +225,7 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -247,7 +247,20 @@ }, { "cell_type": "code", - "execution_count": 97, + "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": [ { @@ -256,7 +269,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.061s\n", + "Ran 100 tests in 0.069s\n", "\n", "OK\n" ] @@ -276,7 +289,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -295,63 +308,20 @@ }, { "cell_type": "code", - "execution_count": 107, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "....................................................................................................\n", - "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.071s\n", - "\n", - "OK\n" - ] - } - ], - "source": [ - "# This will test your function \n", - "test_factorial(factorial)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 7. Write a function that takes a list and returns a list of the unique values.\n", - "\n", - "`NOTE: You cannot use set. 🤔`" - ] - }, - { - "cell_type": "code", - "execution_count": 118, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ - "def unique(arr):\n", - " pass\n", - "\n", - "def unique(arr):\n", - " u_values = []\n", - " \n", - " for i in arr:\n", - " uniq = True\n", - " for value in u_values:\n", - " if i == value:\n", - " uniq = False\n", - " break\n", - " \n", - " if uniq:\n", - " u_values = u_values + [i]\n", - " \n", - " return u_values" + "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": 119, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -360,7 +330,7 @@ "text": [ "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.201s\n", + "Ran 100 tests in 0.142s\n", "\n", "OK\n" ] @@ -368,440 +338,338 @@ ], "source": [ "# This will test your function \n", - "test_unique(unique)" + "test_factorial(factorial)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## 8. Write a function that calculates the standard deviation of a list.\n", - "`NOTE: Do not use any libraries or already built functions. 😉`" + "## 7. Write a function that takes a list and returns a list of the unique values.\n", + "\n", + "`NOTE: You cannot use set. 🤔`" ] }, { "cell_type": "code", - "execution_count": 158, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ - "def st_dev(arr):\n", + "def unique(arr):\n", " 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" + "\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": 159, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "....................................................................................................\n", + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.057s\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", - "OK\n" - ] - } - ], - "source": [ - "test_stdev(st_dev)" - ] - }, - { - "cell_type": "code", - "execution_count": 162, - "metadata": {}, - "outputs": [], - "source": [ - "# This will test your function\n", - "#test_stdev(st_dev)\n", - "\n", - "# 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\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": 163, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "....................................................................................................\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.065s\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", - "OK\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" ] - } - ], - "source": [ - "test_stdev(st_dev)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 9. Write a function to check if a string is a pangram, i.e.: if it contains all the letters of the alphabet at least once. Mind that the strings may contain characters that are not letters." - ] - }, - { - "cell_type": "code", - "execution_count": 176, - "metadata": {}, - "outputs": [], - "source": [ - "def pangram(string):\n", - " 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": 177, - "metadata": {}, - "outputs": [ + }, { "name": "stderr", "output_type": "stream", "text": [ - "..............................\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_unique..TestKnown)\n", "----------------------------------------------------------------------\n", - "Ran 30 tests in 0.024s\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", - "OK\n" - ] - } - ], - "source": [ - "# This will test your function \n", - "test_pangram(pangram)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 10. Write a function to check if a given password is strong (at least 8 characters, at least one lower case, at least one upper case, at least one number and at least one special character). It should output True if strong and False if not.\n", - "`Valid special characters: # @ ! $ % & ( ) ^ * [ ] { }`" - ] - }, - { - "cell_type": "code", - "execution_count": 221, - "metadata": {}, - "outputs": [], - "source": [ - "def check_pass(string):\n", - " 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": 222, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "....................................................................................................\n", - "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.061s\n", - "\n", - "OK\n" - ] - } - ], - "source": [ - "# This will test your function \n", - "test_pass(check_pass)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## BONUS" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 11. Write a function that returns the mode of a list, i.e.: the element that appears the most times.\n", - "`NOTE: You should not use count... 🧐`" - ] - }, - { - "cell_type": "code", - "execution_count": 223, - "metadata": {}, - "outputs": [], - "source": [ - "def mode_counter(arr):\n", - " pass\n", - "\n", - "def mode_counter(arr):\n", - " mode = None\n", - " i_most = 0\n", - " \n", - " for i in arr:\n", - " count = 0\n", - "\n", - " #I tried many times but I can't finally get the right result!\n", - " " - ] - }, - { - "cell_type": "code", - "execution_count": 224, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 5 : Should be 5\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 9 : Should be 9\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 5 : Should be 5\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 4 : Should be 4\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 4 : Should be 4\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 24 : Should be 24\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 24 : Should be 24\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 16 : Should be 16\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 19 : Should be 19\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 5 : Should be 5\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 7 : Should be 7\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\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" ] }, @@ -810,156 +678,148 @@ "output_type": "stream", "text": [ "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 25 : Should be 25\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 17 : Should be 17\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 9 : Should be 9\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 4 : Should be 4\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 7 : Should be 7\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 18 : Should be 18\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 23 : Should be 23\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 17 : Should be 17\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 22 : Should be 22\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 20 : Should be 20\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 5 : Should be 5\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 4 : Should be 4\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 14 : Should be 14\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 4 : Should be 4\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 9 : Should be 9\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 12 : Should be 12\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" ] }, @@ -968,156 +828,148 @@ "output_type": "stream", "text": [ "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 19 : Should be 19\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 23 : Should be 23\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 9 : Should be 9\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 25 : Should be 25\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 20 : Should be 20\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 21 : Should be 21\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 1 : Should be 1\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 16 : Should be 16\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 24 : Should be 24\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 19 : Should be 19\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 20 : Should be 20\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 15 : Should be 15\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" ] }, @@ -1126,156 +978,148 @@ "output_type": "stream", "text": [ "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 25 : Should be 25\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 7 : Should be 7\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 2 : Should be 2\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 2 : Should be 2\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 17 : Should be 17\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 1 : Should be 1\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 22 : Should be 22\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 25 : Should be 25\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 15 : Should be 15\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 17 : Should be 17\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 19 : Should be 19\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 18 : Should be 18\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 23 : Should be 23\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" ] }, @@ -1284,215 +1128,396 @@ "output_type": "stream", "text": [ "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 5 : Should be 5\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 13 : Should be 13\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 16 : Should be 16\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 15 : Should be 15\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 12 : Should be 12\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 1 : Should be 1\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 18 : Should be 18\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 1 : Should be 1\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\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 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 3 : Should be 3\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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 9 : Should be 9\n", + "Ran 100 tests in 0.192s\n", "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 22 : Should be 22\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 23 : Should be 23\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 10 : Should be 10\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 7 : Should be 7\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 20 : Should be 20\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 21 : Should be 21\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 2 : Should be 2\n", - "\n" + "FAILED (errors=100)\n" ] - }, + } + ], + "source": [ + "# This will test your function \n", + "test_unique(unique)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 8. Write a function that calculates the standard deviation of a list.\n", + "`NOTE: Do not use any libraries or already built functions. 😉`" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "def st_dev(arr):\n", + " 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", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 11 : Should be 11\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", - "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 25 : Should be 25\n", - "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 12 : Should be 12\n", + "Ran 100 tests in 0.185s\n", "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "# This will test your function\n", + "#test_stdev(st_dev)\n", + "\n", + "# 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\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", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 20 : Should be 20\n", + "Ran 100 tests in 0.154s\n", "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "OK\n" + ] + } + ], + "source": [ + "test_stdev(st_dev)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 9. Write a function to check if a string is a pangram, i.e.: if it contains all the letters of the alphabet at least once. Mind that the strings may contain characters that are not letters." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "def pangram(string):\n", + " 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": 23, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 8 : Should be 8\n", + "Ran 30 tests in 0.034s\n", "\n", - "======================================================================\n", - "FAIL: runTest (mod.testing.test_mode..TestKnown)\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_pangram(pangram)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 10. Write a function to check if a given password is strong (at least 8 characters, at least one lower case, at least one upper case, at least one number and at least one special character). It should output True if strong and False if not.\n", + "`Valid special characters: # @ ! $ % & ( ) ^ * [ ] { }`" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "def check_pass(string):\n", + " 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": 25, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Traceback (most recent call last):\n", - " File \"C:\\Users\\photo\\Desktop\\Ironhack\\labs\\lab-functions\\mod\\testing.py\", line 127, in runTest\n", - " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", - "AssertionError: None != 6 : Should be 6\n", + "Ran 100 tests in 0.167s\n", "\n", + "OK\n" + ] + } + ], + "source": [ + "# This will test your function \n", + "test_pass(check_pass)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## BONUS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 11. Write a function that returns the mode of a list, i.e.: the element that appears the most times.\n", + "`NOTE: You should not use count... 🧐`" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "def mode_counter(arr):\n", + " 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": 33, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", "----------------------------------------------------------------------\n", - "Ran 100 tests in 0.082s\n", + "Ran 100 tests in 0.161s\n", "\n", - "FAILED (failures=100)\n" + "OK\n" ] } ], @@ -1512,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)"