diff --git a/main.ipynb b/main.ipynb index b05630a..e440f9a 100644 --- a/main.ipynb +++ b/main.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -37,19 +37,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def greater(a,b):\n", - "#your code here" + " if a>b:\n", + " return a\n", + " elif b>a:\n", + " return b" ] }, { "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.102s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greater(greater)" @@ -57,11 +72,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "#your code here" + "greater(3,10)" ] }, { @@ -73,18 +99,57 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ - "#your code here" + "def greatest(list):\n", + " largest=list[0]\n", + " for i in list:\n", + " if i > largest:\n", + " largest=i\n", + " return largest\n", + " \n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a=[1, 4, 5, 7,10]\n", + "greatest(a)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.112s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_greatest(greatest)" @@ -99,21 +164,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "def sum_all(lst):\n", - "#your code here" + " total=0\n", + " for i in lst:\n", + " total+=i\n", + " return total\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.115s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_sum(sum_all)" @@ -128,21 +208,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ "def mult_all(lst):\n", - "#your code here" + " multi=1\n", + " for i in lst:\n", + " multi*=i\n", + " return multi" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mult(mult_all)" @@ -157,19 +252,41 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "def oper_all(arr, oper = \"*\"):\n", - "#your code here" + " if oper == \"+\":\n", + " num1=0\n", + " for i in arr:\n", + " num1+=i\n", + " return num1\n", + " if oper == \"*\":\n", + " num2=1\n", + " for i in arr:\n", + " num2*=i\n", + " return num2\n", + "\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.110s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_operations(oper_all)" @@ -184,12 +301,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ "def factorial(n):\n", - "#your code here" + " if n <= 0:\n", + " return 1\n", + " else:\n", + " factor=n*factorial(n-1)\n", + " return factor\n" ] }, { @@ -213,9 +334,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 40, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.110s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_factorial(factorial)" @@ -232,19 +365,53 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "def unique(lst_un):\n", - "#your code here" + " new_list=[]\n", + " for i in lst_un:\n", + " if i not in new_list:\n", + " new_list.append(i)\n", + " return new_list" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4]\n" + ] + } + ], + "source": [ + "lst_un=[1,2,3,4,1,2,3,4]\n", + "unique(lst_un)" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.237s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_unique(unique)" @@ -260,19 +427,76 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "def mode_counter(arr):\n", - "#your code here" + " counter={}\n", + " for i in arr:\n", + " if i in counter:\n", + " counter[i]+=1\n", + " else:\n", + " counter[i]=1\n", + "\n", + "\n", + " counter_value = None\n", + " mode_count=0\n", + "\n", + " for key in counter:\n", + " if counter[key] > mode_count:\n", + " mode_count=counter[key]\n", + " counter_value= key\n", + " return counter_value\n", + "\n", + " " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "arr=[2,3,4,4]\n", + "mode_counter(arr)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................." + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "...............................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.160s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_mode(mode_counter)" @@ -288,19 +512,526 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def st_dev(list_sd):\n", - "#your code here" + " total=0\n", + " for i in list_sd:\n", + " total+=i\n", + "\n", + " count=0\n", + " for i in list_sd:\n", + " count+=1\n", + "\n", + " mean=total/count\n", + "\n", + " st=0\n", + " for i in list_sd:\n", + " diff= i-mean\n", + " st+=diff*diff\n", + "\n", + " variance=st/count\n", + " std=variance**0.5\n", + " return std" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 58, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "1.4142135623730951" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_sd=[1,2,3,4,5]\n", + "st_dev(list_sd)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "..FF.F" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "FFF...F.F.FFF....F...FFFFFF.F.....F.F.F.FFF.F.F..F.F...F..F..F..FFF..F...F.FFF.F.F..FF.FFFFFF.\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 579.626193931363 != 587.8482527438252 within 5 delta (8.222058812462251 difference) : Should be 587.8482527438252\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 552.2105129543297 != 560.0436774350021 within 5 delta (7.833164480672394 difference) : Should be 560.0436774350021\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 537.1045210468122 != 549.7440037844613 within 5 delta (12.639482737649018 difference) : Should be 549.7440037844613\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 616.8028411883 != 628.1212685798245 within 5 delta (11.318427391524438 difference) : Should be 628.1212685798245\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 597.0119920411607 != 606.268543921326 within 5 delta (9.256551880165262 difference) : Should be 606.268543921326\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 560.9653152361197 != 569.1550231142078 within 5 delta (8.18970787808803 difference) : Should be 569.1550231142078\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 567.8965192702686 != 577.9485654753158 within 5 delta (10.05204620504719 difference) : Should be 577.9485654753158\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 613.4715017396587 != 628.621227464558 within 5 delta (15.149725724899326 difference) : Should be 628.621227464558\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 500.6636151704611 != 522.9260913070766 within 5 delta (22.262476136615476 difference) : Should be 522.9260913070766\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 528.4331391592775 != 535.9290190800117 within 5 delta (7.495879920734183 difference) : Should be 535.9290190800117\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 624.8950823091343 != 638.9394219957297 within 5 delta (14.044339686595436 difference) : Should be 638.9394219957297\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 566.0461681372024 != 593.6742296151072 within 5 delta (27.628061477904794 difference) : Should be 593.6742296151072\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 536.5392677171626 != 541.5773056428984 within 5 delta (5.038037925735807 difference) : Should be 541.5773056428984\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 606.8204138362828 != 616.5301569881285 within 5 delta (9.709743151845714 difference) : Should be 616.5301569881285\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 609.3534602960418 != 615.0752145605743 within 5 delta (5.721754264532478 difference) : Should be 615.0752145605743\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 556.5202084517947 != 563.4337680469727 within 5 delta (6.913559595177958 difference) : Should be 563.4337680469727\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 597.1297694806381 != 609.4430189388778 within 5 delta (12.313249458239738 difference) : Should be 609.4430189388778\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 658.1343771589792 != 668.665195859053 within 5 delta (10.530818700073837 difference) : Should be 668.665195859053\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 574.0351653807892 != 580.1097807422022 within 5 delta (6.074615361413066 difference) : Should be 580.1097807422022\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 522.8846436755587 != 533.2398002919368 within 5 delta (10.355156616378167 difference) : Should be 533.2398002919368\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 512.8287123800842 != 521.3057943115497 within 5 delta (8.477081931465477 difference) : Should be 521.3057943115497\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 638.3270664690494 != 650.9684335960243 within 5 delta (12.641367126974842 difference) : Should be 650.9684335960243\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 584.4407394177416 != 591.5251282506233 within 5 delta (7.0843888328817 difference) : Should be 591.5251282506233\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 543.1104342229255 != 549.1118366769596 within 5 delta (6.001402454034064 difference) : Should be 549.1118366769596\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 489.59292483648903 != 497.6859181434407 within 5 delta (8.092993306951655 difference) : Should be 497.6859181434407\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 599.9490357491909 != 607.7918396769306 within 5 delta (7.8428039277397374 difference) : Should be 607.7918396769306\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 401.0763181961152 != 417.4534673899565 within 5 delta (16.377149193841262 difference) : Should be 417.4534673899565\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 555.5744502073356 != 563.9294220451069 within 5 delta (8.354971837771245 difference) : Should be 563.9294220451069\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 544.3069188553511 != 551.8149551659004 within 5 delta (7.508036310549301 difference) : Should be 551.8149551659004\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 489.7690552699302 != 502.4924482281458 within 5 delta (12.723392958215584 difference) : Should be 502.4924482281458\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 554.2848306325799 != 575.2085527188196 within 5 delta (20.923722086239763 difference) : Should be 575.2085527188196\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 573.1202594577978 != 579.9029838286552 within 5 delta (6.782724370857409 difference) : Should be 579.9029838286552\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 612.0418064474895 != 629.7858231228581 within 5 delta (17.744016675368584 difference) : Should be 629.7858231228581\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 543.1236011696036 != 548.7519753423917 within 5 delta (5.628374172788085 difference) : Should be 548.7519753423917\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 540.5743516202277 != 545.6502784889735 within 5 delta (5.075926868745796 difference) : Should be 545.6502784889735\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 561.6467113367509 != 567.8529407503677 within 5 delta (6.206229413616825 difference) : Should be 567.8529407503677\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 566.4068390252294 != 571.4416654984734 within 5 delta (5.034826473244038 difference) : Should be 571.4416654984734\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 518.3930589556608 != 525.351666409954 within 5 delta (6.958607454293201 difference) : Should be 525.351666409954\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 604.3403251932864 != 610.6030865068573 within 5 delta (6.262761313570877 difference) : Should be 610.6030865068573\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 517.2005276509965 != 532.1949523626295 within 5 delta (14.994424711632973 difference) : Should be 532.1949523626295\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 622.5905754919183 != 628.4366246448153 within 5 delta (5.846049152896967 difference) : Should be 628.4366246448153\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 563.9661026355634 != 572.7102845905227 within 5 delta (8.744181954959345 difference) : Should be 572.7102845905227\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 593.1364705877168 != 599.0384713823298 within 5 delta (5.902000794613059 difference) : Should be 599.0384713823298\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 583.6243320573496 != 594.3339286824106 within 5 delta (10.709596625060954 difference) : Should be 594.3339286824106\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 623.6296746374688 != 631.1890982109469 within 5 delta (7.559423573478057 difference) : Should be 631.1890982109469\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 586.849613730641 != 598.0287061114486 within 5 delta (11.179092380807674 difference) : Should be 598.0287061114486\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 441.0331922247927 != 451.9245406881446 within 5 delta (10.891348463351903 difference) : Should be 451.9245406881446\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 597.2448780264458 != 607.1173630140372 within 5 delta (9.872484987591406 difference) : Should be 607.1173630140372\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 544.2702300634616 != 555.9763054069058 within 5 delta (11.70607534344424 difference) : Should be 555.9763054069058\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_stdev..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 142, in runTest\n", + " self.assertAlmostEqual(fn(self.input), self.output, delta=5, msg=f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: 581.268672942752 != 587.9887652455345 within 5 delta (6.720092302782518 difference) : Should be 587.9887652455345\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.133s\n", + "\n", + "FAILED (failures=50)\n" + ] + } + ], "source": [ "# This will test your function \n", "test_stdev(st_dev)" @@ -315,19 +1046,365 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "def pangram(string):\n", - "#your code here" + " \n", + " lowerstring=string.lower()\n", + "\n", + " alphabet = []\n", + " code=ord('a')\n", + "\n", + " while code <= ord('z'):\n", + " alphabet += [chr(code)]\n", + " code += 1\n", + "\n", + " find = []\n", + "\n", + " for ch in lowerstring:\n", + " if ord(ch) >= ord('a') and ord(ch) <= ord('z'):\n", + " count = 0 \n", + " for a in find:\n", + " if a == ch:\n", + " count = 1\n", + " if count == 0:\n", + " find += [ch]\n", + "\n", + " length = 0\n", + " for i in find:\n", + " length += 1\n", + "\n", + " if length == 26:\n", + " print(f\"{string} is a pangram\")\n", + " else:\n", + " print(f\"{string} is not a pangram\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != True : Should be True\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "======================================================================\n", + "FAIL: runTest (mod.testing.test_pangram..TestKnown.runTest)\n", + "----------------------------------------------------------------------\n", + "Traceback (most recent call last):\n", + " File \"c:\\Users\\SAMSUNG\\Ironhack\\Day3\\lab-functions-en\\mod\\testing.py\", line 172, in runTest\n", + " self.assertEqual(fn(self.input), self.output, f\"Should be {self.output}\")\n", + " ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "AssertionError: None != False : Should be False\n", + "\n", + "----------------------------------------------------------------------\n", + "Ran 30 tests in 0.054s\n", + "\n", + "FAILED (failures=30)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Waltz, nymph, for quick jigs vex Bud. is a pangram\n", + "Sphinx of black quartz, judge my vow. is a pangram\n", + "Pack my box with five dozen liquor jugs. is a pangram\n", + "Glib jocks quiz nymph to vex dwarf. is a pangram\n", + "Jackdaws love my big sphinx of quartz. is a pangram\n", + "The five boxing wizards jump quickly. is a pangram\n", + "How vexingly quick daft zebras jump! is a pangram\n", + "Quick zephyrs blow, vexing daft Jim. is a pangram\n", + "Two driven jocks help fax my big quiz. is a pangram\n", + "The jay, pig, fox, zebra and my wolves quack! is a pangram\n", + "Sympathizing would fix Quaker objectives. is a pangram\n", + "A wizard's job is to vex chumps quickly in fog. is a pangram\n", + "Watch 'Jeopardy!', Alex Trebek's fun TV quiz game. is a pangram\n", + "By Jove, my quick study of lexicography won a prize! is a pangram\n", + "Waxy and quivering, jocks fumble the pizza. is a pangram\n", + "ictkyinjquvmbpybyukafxjbanpnbtmckjgnibaafqhrvsnnoxiuitiszlxrmoqtavuidwogdrlevsdxse is a pangram\n", + "gegdgbundfneghradrkzifrcwouvynlekuktmyqqestznw is not a pangram\n", + "mjmowdytizeuvuuslnorsxzzkdtonaazyydgaufwbyxezqublzpqgogdmbolqvabjssshfm is not a pangram\n", + "lqkxolydtjclqhceubiaosmyghdo is not a pangram\n", + "feixmsaltpbgmjsdglsbwnaefusubcxmshpnddmq is not a pangram\n", + "efoqxfrvfsiiqbigczpqnrdppevtzoangvmzxf is not a pangram\n", + "nuuzsxliqwrkcghapqjqhdfbnxianjlryviyijzlqfwholzjuml is not a pangram\n", + "qxufhadyoxlkwlgjrbzdgrfedgpfbwecg is not a pangram\n", + "wqsgyrzlutpmfktbldhzouscgezcpfikqqswzelzmbwpghucq is not a pangram\n", + "zzurasodlleodcftygtupatzysytaaocwbvpdkqrlmuxdirogjmwhwriwkwbbevpxdvnfhqdrmneqhiwbiqwlfeedfczph is a pangram\n", + "ytqnzkgcxwhidalwpxbjpnbzww is not a pangram\n", + "ftkzzkapwnlkoojebmolcvmjfevysucdxz is not a pangram\n", + "bdvvciimemqhptbiblsohilshfouzmuvxghrxaukemblyljaphjrgxjwqofyezqtawtijskxxlnyhjr is a pangram\n", + "pmmdyfkewnfonmohvlpliwoptwehubsywlsgaeqrrn is not a pangram\n", + "dkkrmfwaxymoxooxpcupnygasphltzcjtdgjiiwuzscxpaheebxzmorecgc is not a pangram\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pangram(pangram)" @@ -344,19 +1421,60 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "def sort_alpha(string):\n", - "#your code here" + " listofwords = []\n", + " word = \"\"\n", + " for ch in string:\n", + " if ch == \",\":\n", + " listofwords.append(word.strip())\n", + " word = \"\"\n", + " else:\n", + " word += ch\n", + "\n", + " if word:\n", + " listofwords.append(word.strip())\n", + "\n", + " sortedlist=sorted(listofwords)\n", + "\n", + " \n", + "\n", + " count = 0\n", + " for i in sortedlist:\n", + " count += 1\n", + "\n", + "\n", + " result = \"\"\n", + " index = 0 \n", + " for woo in sortedlist:\n", + " result += woo\n", + " if index != count-1:\n", + " result+=\",\"\n", + " index += 1\n", + "\n", + " return result\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.096s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_alpha(sort_alpha)" @@ -371,19 +1489,86 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def check_pass(password):\n", - "#your code here" + " #at least 8 characters\n", + " \n", + " numofchar=False\n", + " count=0\n", + " for i in password:\n", + " count+=1\n", + " \n", + " if count >= 8:\n", + " numofchar=True\n", + " else:\n", + " numofchar=False\n", + "\n", + " #at least one lower case\n", + " haslower=False\n", + "\n", + " for l in password:\n", + " if ord('a') <= ord(l) <= ord('z'):\n", + " haslower=True\n", + " break\n", + "\n", + " \n", + " #at least one upper case\n", + " hasupper=False\n", + "\n", + " for u in password:\n", + " if ord('A') <= ord(u) <= ord('Z'):\n", + " hasupper =True\n", + " break\n", + "\n", + "\n", + " #at least one number\n", + " hasnumber =False\n", + "\n", + " for n in password:\n", + " if ord('0') <= ord(n) <= ord('9'):\n", + " hasnumber=True\n", + " break\n", + "\n", + " hasspecial=False\n", + " special_chars = \"!@#$%^&*()-_=+[]{}|;:'\\\",.<>?/`~\"\n", + "\n", + " for s in password:\n", + "\n", + " for char in special_chars:\n", + " if s == char:\n", + " hasspecial=True\n", + " break\n", + "\n", + " if hasspecial:\n", + " break\n", + "\n", + " #check if the password is strong or not\n", + " if numofchar ==True and haslower == True and hasupper == True and hasnumber ==True and hasspecial ==True:\n", + " return True\n", + " else:\n", + " return False \n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "....................................................................................................\n", + "----------------------------------------------------------------------\n", + "Ran 100 tests in 0.101s\n", + "\n", + "OK\n" + ] + } + ], "source": [ "# This will test your function \n", "test_pass(check_pass)" @@ -392,7 +1577,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -406,12 +1591,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" - }, - "vscode": { - "interpreter": { - "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" - } + "version": "3.13.5" } }, "nbformat": 4, diff --git a/mod/__pycache__/testing.cpython-313.pyc b/mod/__pycache__/testing.cpython-313.pyc new file mode 100644 index 0000000..918f268 Binary files /dev/null and b/mod/__pycache__/testing.cpython-313.pyc differ