diff --git a/main.ipynb b/main.ipynb index 73f285a..a05a153 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,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def greater(a,b):\n", - " pass" + " if a > b:\n", + " return a\n", + " elif a < b:\n", + " return b\n", + " else:\n", + " return \"They're equal\"\n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.051s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" @@ -64,19 +82,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 55, "metadata": {}, "outputs": [], "source": [ "def greatest(arr):\n", - " pass" + " a = arr[0]\n", + " \n", + " for i in arr:\n", + " if i > a:\n", + " a = i\n", + " return a" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 56, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.068s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" @@ -91,19 +126,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def sum_all(arr):\n", - " pass" + " s = 0\n", + " for i in arr:\n", + " s += i\n", + " return s" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.068s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" @@ -118,19 +168,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def mult_all(arr):\n", - " pass" + " m = 1\n", + " for i in arr:\n", + " m *= i\n", + " return m" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.052s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -145,19 +210,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper):\n", - " pass" + " s = 0\n", + " m = 1\n", + " \n", + " if oper == '+':\n", + " for i in arr:\n", + " s += i\n", + " return s \n", + "\n", + " elif oper == '*':\n", + " for i in arr:\n", + " m *= i\n", + " return m\n", + " \n", + " else:\n", + " print(\"Invalid operator\")\n", + "\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.062s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -172,19 +264,42 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 260, "metadata": {}, "outputs": [], "source": [ "def factorial(n):\n", - " pass" + " f = 1\n", + " \n", + " if n < 0:\n", + " return \"No factorial for negative numbers\"\n", + " \n", + " elif n == 0:\n", + " return \"The factorial is 0\"\n", + " \n", + " else:\n", + " for i in range(n):\n", + " f += f*i\n", + " return f\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 261, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.148s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -201,19 +316,59 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 90, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[4, 8, 9, 0, 1, 2]\n" + ] + } + ], "source": [ "def unique(arr):\n", - " pass" + " aux = []\n", + " count = 0\n", + " \n", + " for i in arr:\n", + " aux.append(i)\n", + " \n", + " for i in arr:\n", + " for a in aux:\n", + " if a == i:\n", + " count+=1\n", + " #print(count)\n", + " \n", + " if count >= 2:\n", + " #print(a)\n", + " aux.remove(a)\n", + " #print(aux)\n", + " count = 0\n", + " \n", + " return aux\n", + "\n", + "print(unique([1,4,4, 8, 9, 0, 0, 1, 2]))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 91, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.532s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -229,19 +384,51 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 124, "metadata": {}, "outputs": [], "source": [ "def mode_counter(arr):\n", - " pass" + " aux = []\n", + " mode = [0, 0]\n", + " count = 0\n", + " \n", + " for i in arr:\n", + " aux.append(i)\n", + " \n", + " for i in arr:\n", + " for a in aux:\n", + " if a == i:\n", + " count+=1\n", + " #print(count)\n", + " \n", + " if count > mode[1]:\n", + " mode[0] = a\n", + " mode[1] = count\n", + " #print(mode)\n", + " count = 0\n", + " \n", + " return mode[0]\n", + "\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 125, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.154s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -257,20 +444,451 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 142, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "37.92673858902186\n" + ] + } + ], "source": [ "from statistics import stdev\n", + "\n", "def st_dev(arr):\n", - " pass" + " #std deviation = ((sum(each value - avg)**2) / number of values)**0.5\n", + " \n", + " n = len(arr) #number of values\n", + " s = 0 #sum variable\n", + " x = 0\n", + " \n", + " for i in arr: #calculating the avg\n", + " s += i\n", + " \n", + " avg = s/n\n", + " \n", + " for i in arr: #calculating the sum part\n", + " x += (i-avg)**2 \n", + " \n", + " return (x/n)**0.5 #returns the square root of the whole thing\n", + " \n", + "print(st_dev([10, 12, 23, 78, 16, 23, 21, 123]))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 143, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "FF.FF.F.FFFFFFFF..F..F...F.....F.FFFFF..F..FFFFF....F.F.FFFF....F.F.F..F.F....F....F.F..F....FFF...F\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 522.2413492433399 != 534.5310624369333 within 5 delta (12.289713193593457 difference) : Should be 534.5310624369333\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 556.2747258434854 != 564.3959543417288 within 5 delta (8.121228498243454 difference) : Should be 564.3959543417288\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 644.1500338995874 != 651.4287963911918 within 5 delta (7.278762491604425 difference) : Should be 651.4287963911918\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 592.5741230174006 != 599.7571019177789 within 5 delta (7.182978900378316 difference) : Should be 599.7571019177789\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 586.6729557639361 != 600.4789142067575 within 5 delta (13.805958442821407 difference) : Should be 600.4789142067575\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 572.0966827260535 != 578.8672933411515 within 5 delta (6.770610615098008 difference) : Should be 578.8672933411515\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 585.1130153692002 != 590.8215702122378 within 5 delta (5.708554843037632 difference) : Should be 590.8215702122378\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 515.6281089988173 != 520.7588633191856 within 5 delta (5.130754320368283 difference) : Should be 520.7588633191856\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 579.175535600445 != 587.8854308939774 within 5 delta (8.70989529353244 difference) : Should be 587.8854308939774\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 578.4729654263245 != 586.0350244930107 within 5 delta (7.5620590666861744 difference) : Should be 586.0350244930107\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 579.9772239986178 != 585.225993643792 within 5 delta (5.248769645174207 difference) : Should be 585.225993643792\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 568.7336138029717 != 590.202763631112 within 5 delta (21.469149828140303 difference) : Should be 590.202763631112\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 431.3308289743137 != 448.94336059868516 within 5 delta (17.612531624371456 difference) : Should be 448.94336059868516\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 629.9144504166816 != 636.5803974311627 within 5 delta (6.665947014481162 difference) : Should be 636.5803974311627\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 563.3235804702085 != 568.421635337256 within 5 delta (5.0980548670474946 difference) : Should be 568.421635337256\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 507.7963557262782 != 530.3759958460573 within 5 delta (22.57964011977913 difference) : Should be 530.3759958460573\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 651.6101901012215 != 662.0366151797872 within 5 delta (10.426425078565671 difference) : Should be 662.0366151797872\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 632.3297433467666 != 650.6619379649773 within 5 delta (18.33219461821068 difference) : Should be 650.6619379649773\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 632.4042412689846 != 640.4606710437778 within 5 delta (8.056429774793173 difference) : Should be 640.4606710437778\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 572.2889606153072 != 578.9052377659891 within 5 delta (6.616277150681867 difference) : Should be 578.9052377659891\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 584.4961802685392 != 591.4135356074189 within 5 delta (6.917355338879702 difference) : Should be 591.4135356074189\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 538.4069635870824 != 543.764378759627 within 5 delta (5.35741517254462 difference) : Should be 543.764378759627\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 592.640023432756 != 599.04712880932 within 5 delta (6.4071053765640045 difference) : Should be 599.04712880932\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 497.38272033657177 != 504.2434957468495 within 5 delta (6.860775410277711 difference) : Should be 504.2434957468495\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 621.4002497717886 != 628.7543548633996 within 5 delta (7.354105091611018 difference) : Should be 628.7543548633996\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 600.7747061087042 != 605.8446247364368 within 5 delta (5.069918627732591 difference) : Should be 605.8446247364368\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 587.9965509061691 != 593.3178951248012 within 5 delta (5.3213442186321345 difference) : Should be 593.3178951248012\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 657.7020294722665 != 669.3436771405844 within 5 delta (11.641647668317887 difference) : Should be 669.3436771405844\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 556.0285280022295 != 561.5612864428713 within 5 delta (5.532758440641828 difference) : Should be 561.5612864428713\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 571.1394291239224 != 578.4153839674879 within 5 delta (7.275954843565501 difference) : Should be 578.4153839674879\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 604.6319841166523 != 610.6483709477791 within 5 delta (6.016386831126738 difference) : Should be 610.6483709477791\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 586.4320210443171 != 608.5692688142041 within 5 delta (22.137247769886926 difference) : Should be 608.5692688142041\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 516.7343386415324 != 530.8940654894626 within 5 delta (14.159726847930187 difference) : Should be 530.8940654894626\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 606.7241018803103 != 624.3139502659956 within 5 delta (17.589848385685286 difference) : Should be 624.3139502659956\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 548.8199530894361 != 561.7351307714848 within 5 delta (12.915177682048693 difference) : Should be 561.7351307714848\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 588.5990971080499 != 594.2317526917521 within 5 delta (5.632655583702217 difference) : Should be 594.2317526917521\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 576.8026151143223 != 583.794417241881 within 5 delta (6.991802127558685 difference) : Should be 583.794417241881\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 529.6112567682156 != 535.3369502694301 within 5 delta (5.725693501214437 difference) : Should be 535.3369502694301\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 557.0837140527534 != 584.2743284700184 within 5 delta (27.19061441726501 difference) : Should be 584.2743284700184\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 585.922649137998 != 596.2937666600544 within 5 delta (10.371117522056466 difference) : Should be 596.2937666600544\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 572.8890590476519 != 578.3713759134803 within 5 delta (5.482316865828352 difference) : Should be 578.3713759134803\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 584.0254104060884 != 589.9547544048594 within 5 delta (5.929343998770946 difference) : Should be 589.9547544048594\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 698.4737939477457 != 714.1717943034828 within 5 delta (15.698000355737122 difference) : Should be 714.1717943034828\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 539.7218104292814 != 553.0502818783426 within 5 delta (13.328471449061226 difference) : Should be 553.0502818783426\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 549.1558339397108 != 554.6202056804455 within 5 delta (5.464371740734691 difference) : Should be 554.6202056804455\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 553.9653198060923 != 559.4775483062958 within 5 delta (5.512228500203491 difference) : Should be 559.4775483062958\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + "AssertionError: 506.33289273351465 != 517.223018012848 within 5 delta (10.890125279333347 difference) : Should be 517.223018012848\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.089s\n", + "\n", + "FAILED (failures=47)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_stdev(st_dev)" @@ -285,19 +903,40 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 246, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - " pass" + " \n", + " alphab = \"abcdefghijklmnopqrstuvwxyz\"\n", + " \n", + " for a in alphab:\n", + " if a not in string.lower():\n", + " return False\n", + " \n", + " return True\n", + " \n", + " \n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 247, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..............................\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.027s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -314,19 +953,1098 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 207, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "IndexError", + "evalue": "list assignment index out of range", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "Input \u001b[1;32mIn [207]\u001b[0m, in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 15\u001b[0m final \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m i \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 18\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m final\n\u001b[1;32m---> 20\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[43msort_alpha\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mloim,por,adf,edg,qb,ap\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m)\n", + "Input \u001b[1;32mIn [207]\u001b[0m, in \u001b[0;36msort_alpha\u001b[1;34m(string)\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m s \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mlen\u001b[39m(string)):\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m string[s] \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m----> 8\u001b[0m aux[n] \u001b[38;5;241m=\u001b[39m string[s]\n\u001b[0;32m 9\u001b[0m n\u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m \n\u001b[0;32m 11\u001b[0m \u001b[38;5;28msorted\u001b[39m(aux)\n", + "\u001b[1;31mIndexError\u001b[0m: list assignment index out of range" + ] + } + ], "source": [ "def sort_alpha(string):\n", - " pass" + " aux = []\n", + " final = ' '\n", + " n = 0\n", + " \n", + " for s in range(len(string)):\n", + " if string[s] != ',':\n", + " aux[n] = string[s]\n", + " n+=1 \n", + " \n", + " sorted(aux)\n", + " print(aux)\n", + " \n", + " for i in aux:\n", + " final += i + \",\"\n", + " \n", + " \n", + " return final\n", + "\n", + "print(sort_alpha(\"loim,por,adf,edg,qb,ap\"))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 199, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "======================================================================\n", + "ERROR: runTest (mod.testing.test_alpha..TestKnown)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"C:\\Users\\mayar\\OneDrive\\Área de Trabalho\\labs\\lab-functions\\mod\\testing.py\", line 187, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " File \"C:\\Users\\mayar\\AppData\\Local\\Temp\\ipykernel_1556\\3909995013.py\", line 8, in sort_alpha\n", + " aux[n].append(s)\n", + "IndexError: list index out of range\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.103s\n", + "\n", + "FAILED (errors=100)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_alpha(sort_alpha)" @@ -342,28 +2060,186 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 284, "metadata": {}, "outputs": [], "source": [ "def check_pass(string):\n", - " pass" + " \n", + " #Since the idea was not to use built in functions, I tried to do everything with only basic instructions, no isalpha or isnumerical, for example\n", + " \n", + " sp_c = \"#@!$%&()^*[]{}\" #strings with all the characters needed\n", + " alpha = \"abcdefghijklmnopqrstuvwxyz\"\n", + " ALPHA = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n", + " num = \"0123456789\"\n", + " points = [0, 0, 0, 0] #list that assigns points to each criteria met: lower, upper, number and special char.\n", + " count = 0 #to count the lenght since len() couldn't be used\n", + " \n", + " for s in string:\n", + " count+=1\n", + " \n", + " if count < 8:\n", + " return False\n", + " \n", + " else:\n", + " for s in string:\n", + " if s in sp_c:\n", + " points[0] += 1\n", + " if s in alpha:\n", + " points[1] += 1\n", + " if s in ALPHA:\n", + " points[2] += 1\n", + " if s in num:\n", + " points[3] += 1\n", + "\n", + " for p in points:\n", + " if p == 0:\n", + " return False\n", + " \n", + " return True\n", + " \n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 282, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.110s\n", + "\n", + "OK\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "z(pbl\n", + "zwSfc1dL{jll)Ow\n", + "}rA4[\n", + "iC3jndgj1zY\n", + "@!jwsy6YnCgYv\n", + "$g3w\n", + "sgq)o)9dS\n", + "pf\n", + "nb\n", + "]Y\n", + "WJ\n", + "ld\n", + "k]AyGjjs\n", + "zZ\n", + "wXpmjqyhk\n", + "ir\n", + "weNr$v36v*h\n", + "kP2hgCpMhlfeg6p\n", + "zcqp\n", + "s(8\n", + "w[Vwn\n", + "jt\n", + "luf^ak\n", + "M[hk3aFrfD\n", + "iJzUjpiwpBasA\n", + "litlJFfl)ml\n", + "t1amqsgAo&wt^\n", + "ri%jejukD\n", + "ireteySr\n", + "sthlufmzpp\n", + "0jveeo\n", + "3SpmxoGfk1Ngm\n", + "Pi7\n", + "cezvIpz\n", + "(4jdHd$M6vkja\n", + "arcci&iOS\n", + "Pk33zy\n", + "%3KM\n", + "wh\n", + "t)KckRonha\n", + "}wk9zRR[*Z5ac$\n", + "Dvl7LyFnbYw4\n", + "Ucka\n", + "g@5f@2tH!u&hzck\n", + "Fx9{iUkflJ\n", + "O(Bzrn\n", + "pu\n", + "kisfhb\n", + "hhnpr\n", + "zgBrliufB)\n", + "mpJbNpZK1chjBcxs\n", + "4q\n", + "W7Pso!jTs\n", + "AhR\n", + "i*2F&pjpnyza6z\n", + "dxQ@f@vxv%fe3wk\n", + "V@p@jG2G\n", + "QnrxQYPi(Gn\n", + "oz1j8ucbfkx\n", + "b#1lfm\n", + "gl6[iXoo}lnw@\n", + "YRj4d\n", + "gsyfj4dix\n", + "k$h5Pjb\n", + "3rX\n", + "b(a5fbh(fE\n", + "msvfqq*ghKEsAt0W\n", + "dw2\n", + "Z#qs9ni\n", + "smwdwgtwtu\n", + "0be\n", + "vjbxuj1yio3\n", + "Hg^tci5g\n", + "dVs#ynBk\n", + "7o97rraoZ\n", + "se{Qfx7P\n", + "di4OrVr\n", + "docMrPpX0%ryw&t\n", + "qLv6gJNTr^rzgceI\n", + "q55Sj)jtapv2Gy\n", + "Oefnfu\n", + "ahRJCxaI\n", + "UEzf(}u2SNug\n", + "p7N1djkr\n", + "yvllkbs\n", + "p$eyMkmeudnJww\n", + "jzc{xpnxn6o\n", + "Zst\n", + "1p05igv8sJaScj\n", + "XsOhl%dbN8SAX%\n", + "To8Fh\n", + "yt6Xd\n", + "pX!3u}C\n", + "(i%D*\n", + "!zezrsF)lgoy4{Q\n", + "csezh]P\n", + "DhzrvFg\n", + "0Tju)pyMXpf@cb\n", + "dci3oepfXL8rm\n", + "9u\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -377,7 +2253,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.9.12" } }, "nbformat": 4,